# coding: utf-8

"""
    Moodle Webservice API

    Auto-generated OpenAPI spec for Moodle's Webservice API.

    The version of the OpenAPI document: 5.0.3 (Build: 20251006)
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501

import warnings
import json
import re
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr
from typing import Any, Dict, List, Optional, Union
from typing_extensions import Annotated
from poodle_async_full.models.aiplacement_courseassist_explain_text_response import AiplacementCourseassistExplainTextResponse
from poodle_async_full.models.aiplacement_courseassist_summarise_text_response import AiplacementCourseassistSummariseTextResponse
from poodle_async_full.models.aiplacement_editor_generate_image_response import AiplacementEditorGenerateImageResponse
from poodle_async_full.models.aiplacement_editor_generate_text_response import AiplacementEditorGenerateTextResponse
from poodle_async_full.models.auth_email_get_signup_settings_response import AuthEmailGetSignupSettingsResponse
from poodle_async_full.models.auth_email_get_signup_settings_response_warnings_inner import AuthEmailGetSignupSettingsResponseWarningsInner
from poodle_async_full.models.auth_email_signup_user_parameters import AuthEmailSignupUserParameters
from poodle_async_full.models.auth_email_signup_user_response import AuthEmailSignupUserResponse
from poodle_async_full.models.block_accessreview_get_module_data_response_inner import BlockAccessreviewGetModuleDataResponseInner
from poodle_async_full.models.block_accessreview_get_section_data_response_inner import BlockAccessreviewGetSectionDataResponseInner
from poodle_async_full.models.block_recentlyaccesseditems_get_recent_items_response_inner import BlockRecentlyaccesseditemsGetRecentItemsResponseInner
from poodle_async_full.models.block_starredcourses_get_starred_courses_response_inner import BlockStarredcoursesGetStarredCoursesResponseInner
from poodle_async_full.models.core_ai_delete_provider_instance_response import CoreAiDeleteProviderInstanceResponse
from poodle_async_full.models.core_ai_get_policy_status_response import CoreAiGetPolicyStatusResponse
from poodle_async_full.models.core_ai_set_policy_status_response import CoreAiSetPolicyStatusResponse
from poodle_async_full.models.core_ai_set_provider_status_response import CoreAiSetProviderStatusResponse
from poodle_async_full.models.core_auth_confirm_user_parameters import CoreAuthConfirmUserParameters
from poodle_async_full.models.core_auth_confirm_user_response import CoreAuthConfirmUserResponse
from poodle_async_full.models.core_auth_is_age_digital_consent_verification_enabled_response import CoreAuthIsAgeDigitalConsentVerificationEnabledResponse
from poodle_async_full.models.core_auth_is_minor_parameters import CoreAuthIsMinorParameters
from poodle_async_full.models.core_auth_is_minor_response import CoreAuthIsMinorResponse
from poodle_async_full.models.core_auth_request_password_reset_parameters import CoreAuthRequestPasswordResetParameters
from poodle_async_full.models.core_auth_request_password_reset_response import CoreAuthRequestPasswordResetResponse
from poodle_async_full.models.core_auth_resend_confirmation_email_parameters import CoreAuthResendConfirmationEmailParameters
from poodle_async_full.models.core_auth_resend_confirmation_email_response import CoreAuthResendConfirmationEmailResponse
from poodle_async_full.models.core_backup_get_async_backup_links_backup_response import CoreBackupGetAsyncBackupLinksBackupResponse
from poodle_async_full.models.core_backup_get_async_backup_links_restore_response import CoreBackupGetAsyncBackupLinksRestoreResponse
from poodle_async_full.models.core_backup_get_async_backup_progress_response_inner import CoreBackupGetAsyncBackupProgressResponseInner
from poodle_async_full.models.core_backup_get_copy_progress_parameters_copies_inner import CoreBackupGetCopyProgressParametersCopiesInner
from poodle_async_full.models.core_backup_get_copy_progress_response_inner import CoreBackupGetCopyProgressResponseInner
from poodle_async_full.models.core_badges_disable_badges_response import CoreBadgesDisableBadgesResponse
from poodle_async_full.models.core_badges_enable_badges_response import CoreBadgesEnableBadgesResponse
from poodle_async_full.models.core_badges_get_badge_response import CoreBadgesGetBadgeResponse
from poodle_async_full.models.core_badges_get_user_badge_by_hash_response import CoreBadgesGetUserBadgeByHashResponse
from poodle_async_full.models.core_badges_get_user_badges_response import CoreBadgesGetUserBadgesResponse
from poodle_async_full.models.core_block_fetch_addable_blocks_response_inner import CoreBlockFetchAddableBlocksResponseInner
from poodle_async_full.models.core_block_get_course_blocks_response import CoreBlockGetCourseBlocksResponse
from poodle_async_full.models.core_block_get_dashboard_blocks_response import CoreBlockGetDashboardBlocksResponse
from poodle_async_full.models.core_blog_add_entry_parameters_options_inner import CoreBlogAddEntryParametersOptionsInner
from poodle_async_full.models.core_blog_add_entry_response import CoreBlogAddEntryResponse
from poodle_async_full.models.core_blog_delete_entry_response import CoreBlogDeleteEntryResponse
from poodle_async_full.models.core_blog_get_access_information_response import CoreBlogGetAccessInformationResponse
from poodle_async_full.models.core_blog_get_entries_parameters import CoreBlogGetEntriesParameters
from poodle_async_full.models.core_blog_get_entries_response import CoreBlogGetEntriesResponse
from poodle_async_full.models.core_blog_prepare_entry_for_edition_response import CoreBlogPrepareEntryForEditionResponse
from poodle_async_full.models.core_blog_update_entry_response import CoreBlogUpdateEntryResponse
from poodle_async_full.models.core_blog_view_entries_parameters import CoreBlogViewEntriesParameters
from poodle_async_full.models.core_blog_view_entries_response import CoreBlogViewEntriesResponse
from poodle_async_full.models.core_calendar_create_calendar_events_parameters_events_inner import CoreCalendarCreateCalendarEventsParametersEventsInner
from poodle_async_full.models.core_calendar_create_calendar_events_response import CoreCalendarCreateCalendarEventsResponse
from poodle_async_full.models.core_calendar_delete_calendar_events_parameters_events_inner import CoreCalendarDeleteCalendarEventsParametersEventsInner
from poodle_async_full.models.core_calendar_delete_subscription_response import CoreCalendarDeleteSubscriptionResponse
from poodle_async_full.models.core_calendar_get_action_events_by_course_response import CoreCalendarGetActionEventsByCourseResponse
from poodle_async_full.models.core_calendar_get_action_events_by_courses_response import CoreCalendarGetActionEventsByCoursesResponse
from poodle_async_full.models.core_calendar_get_action_events_by_timesort_response import CoreCalendarGetActionEventsByTimesortResponse
from poodle_async_full.models.core_calendar_get_allowed_event_types_response import CoreCalendarGetAllowedEventTypesResponse
from poodle_async_full.models.core_calendar_get_calendar_access_information_response import CoreCalendarGetCalendarAccessInformationResponse
from poodle_async_full.models.core_calendar_get_calendar_day_view_response import CoreCalendarGetCalendarDayViewResponse
from poodle_async_full.models.core_calendar_get_calendar_event_by_id_response import CoreCalendarGetCalendarEventByIdResponse
from poodle_async_full.models.core_calendar_get_calendar_events_parameters_events import CoreCalendarGetCalendarEventsParametersEvents
from poodle_async_full.models.core_calendar_get_calendar_events_parameters_options import CoreCalendarGetCalendarEventsParametersOptions
from poodle_async_full.models.core_calendar_get_calendar_events_response import CoreCalendarGetCalendarEventsResponse
from poodle_async_full.models.core_calendar_get_calendar_export_token_response import CoreCalendarGetCalendarExportTokenResponse
from poodle_async_full.models.core_calendar_get_calendar_monthly_view_response import CoreCalendarGetCalendarMonthlyViewResponse
from poodle_async_full.models.core_calendar_get_calendar_upcoming_view_response import CoreCalendarGetCalendarUpcomingViewResponse
from poodle_async_full.models.core_calendar_get_timestamps_parameters_data_inner import CoreCalendarGetTimestampsParametersDataInner
from poodle_async_full.models.core_calendar_get_timestamps_response import CoreCalendarGetTimestampsResponse
from poodle_async_full.models.core_calendar_submit_create_update_form_response import CoreCalendarSubmitCreateUpdateFormResponse
from poodle_async_full.models.core_calendar_update_event_start_day_response import CoreCalendarUpdateEventStartDayResponse
from poodle_async_full.models.core_change_editmode_response import CoreChangeEditmodeResponse
from poodle_async_full.models.core_check_get_result_admintree_response import CoreCheckGetResultAdmintreeResponse
from poodle_async_full.models.core_cohort_add_cohort_members_parameters_members_inner import CoreCohortAddCohortMembersParametersMembersInner
from poodle_async_full.models.core_cohort_add_cohort_members_response import CoreCohortAddCohortMembersResponse
from poodle_async_full.models.core_cohort_create_cohorts_parameters_cohorts_inner import CoreCohortCreateCohortsParametersCohortsInner
from poodle_async_full.models.core_cohort_create_cohorts_response_inner import CoreCohortCreateCohortsResponseInner
from poodle_async_full.models.core_cohort_delete_cohort_members_parameters_members_inner import CoreCohortDeleteCohortMembersParametersMembersInner
from poodle_async_full.models.core_cohort_get_cohort_members_response_inner import CoreCohortGetCohortMembersResponseInner
from poodle_async_full.models.core_cohort_get_cohorts_response_inner import CoreCohortGetCohortsResponseInner
from poodle_async_full.models.core_cohort_search_cohorts_parameters_context import CoreCohortSearchCohortsParametersContext
from poodle_async_full.models.core_cohort_search_cohorts_response import CoreCohortSearchCohortsResponse
from poodle_async_full.models.core_cohort_update_cohorts_parameters_cohorts_inner import CoreCohortUpdateCohortsParametersCohortsInner
from poodle_async_full.models.core_comment_add_comments_parameters_comments_inner import CoreCommentAddCommentsParametersCommentsInner
from poodle_async_full.models.core_comment_add_comments_response_inner import CoreCommentAddCommentsResponseInner
from poodle_async_full.models.core_comment_get_comments_response import CoreCommentGetCommentsResponse
from poodle_async_full.models.core_competency_count_competencies_parameters_filters_inner import CoreCompetencyCountCompetenciesParametersFiltersInner
from poodle_async_full.models.core_competency_create_competency_framework_parameters_competencyframework import CoreCompetencyCreateCompetencyFrameworkParametersCompetencyframework
from poodle_async_full.models.core_competency_create_competency_framework_response import CoreCompetencyCreateCompetencyFrameworkResponse
from poodle_async_full.models.core_competency_create_competency_parameters_competency import CoreCompetencyCreateCompetencyParametersCompetency
from poodle_async_full.models.core_competency_create_competency_response import CoreCompetencyCreateCompetencyResponse
from poodle_async_full.models.core_competency_create_plan_parameters_plan import CoreCompetencyCreatePlanParametersPlan
from poodle_async_full.models.core_competency_create_plan_response import CoreCompetencyCreatePlanResponse
from poodle_async_full.models.core_competency_create_plan_response_template import CoreCompetencyCreatePlanResponseTemplate
from poodle_async_full.models.core_competency_create_template_parameters_template import CoreCompetencyCreateTemplateParametersTemplate
from poodle_async_full.models.core_competency_create_template_response import CoreCompetencyCreateTemplateResponse
from poodle_async_full.models.core_competency_create_user_evidence_competency_response import CoreCompetencyCreateUserEvidenceCompetencyResponse
from poodle_async_full.models.core_competency_duplicate_competency_framework_response import CoreCompetencyDuplicateCompetencyFrameworkResponse
from poodle_async_full.models.core_competency_duplicate_template_response import CoreCompetencyDuplicateTemplateResponse
from poodle_async_full.models.core_competency_get_scale_values_response_inner import CoreCompetencyGetScaleValuesResponseInner
from poodle_async_full.models.core_competency_grade_competency_in_course_response import CoreCompetencyGradeCompetencyInCourseResponse
from poodle_async_full.models.core_competency_grade_competency_in_plan_response import CoreCompetencyGradeCompetencyInPlanResponse
from poodle_async_full.models.core_competency_grade_competency_response import CoreCompetencyGradeCompetencyResponse
from poodle_async_full.models.core_competency_list_competencies_in_template_response_inner import CoreCompetencyListCompetenciesInTemplateResponseInner
from poodle_async_full.models.core_competency_list_competency_frameworks_response_inner import CoreCompetencyListCompetencyFrameworksResponseInner
from poodle_async_full.models.core_competency_list_course_competencies_response_inner import CoreCompetencyListCourseCompetenciesResponseInner
from poodle_async_full.models.core_competency_list_course_module_competencies_response_inner import CoreCompetencyListCourseModuleCompetenciesResponseInner
from poodle_async_full.models.core_competency_list_plan_competencies_response_inner import CoreCompetencyListPlanCompetenciesResponseInner
from poodle_async_full.models.core_competency_list_user_plans_response_inner import CoreCompetencyListUserPlansResponseInner
from poodle_async_full.models.core_competency_read_competency_framework_response import CoreCompetencyReadCompetencyFrameworkResponse
from poodle_async_full.models.core_competency_read_competency_response import CoreCompetencyReadCompetencyResponse
from poodle_async_full.models.core_competency_read_plan_response import CoreCompetencyReadPlanResponse
from poodle_async_full.models.core_competency_read_template_response import CoreCompetencyReadTemplateResponse
from poodle_async_full.models.core_competency_read_user_evidence_response import CoreCompetencyReadUserEvidenceResponse
from poodle_async_full.models.core_competency_update_competency_framework_parameters_competencyframework import CoreCompetencyUpdateCompetencyFrameworkParametersCompetencyframework
from poodle_async_full.models.core_competency_update_competency_parameters_competency import CoreCompetencyUpdateCompetencyParametersCompetency
from poodle_async_full.models.core_competency_update_course_competency_settings_parameters_settings import CoreCompetencyUpdateCourseCompetencySettingsParametersSettings
from poodle_async_full.models.core_competency_update_plan_parameters_plan import CoreCompetencyUpdatePlanParametersPlan
from poodle_async_full.models.core_competency_update_plan_response import CoreCompetencyUpdatePlanResponse
from poodle_async_full.models.core_competency_update_template_parameters_template import CoreCompetencyUpdateTemplateParametersTemplate
from poodle_async_full.models.core_completion_get_activities_completion_status_response import CoreCompletionGetActivitiesCompletionStatusResponse
from poodle_async_full.models.core_completion_get_course_completion_status_response import CoreCompletionGetCourseCompletionStatusResponse
from poodle_async_full.models.core_completion_mark_course_self_completed_response import CoreCompletionMarkCourseSelfCompletedResponse
from poodle_async_full.models.core_completion_override_activity_completion_status_response import CoreCompletionOverrideActivityCompletionStatusResponse
from poodle_async_full.models.core_completion_update_activity_completion_status_manually_response import CoreCompletionUpdateActivityCompletionStatusManuallyResponse
from poodle_async_full.models.core_contentbank_copy_content_response import CoreContentbankCopyContentResponse
from poodle_async_full.models.core_contentbank_delete_content_response import CoreContentbankDeleteContentResponse
from poodle_async_full.models.core_contentbank_rename_content_response import CoreContentbankRenameContentResponse
from poodle_async_full.models.core_contentbank_set_content_visibility_response import CoreContentbankSetContentVisibilityResponse
from poodle_async_full.models.core_course_add_content_item_to_user_favourites_response import CoreCourseAddContentItemToUserFavouritesResponse
from poodle_async_full.models.core_course_check_updates_parameters_tocheck_inner import CoreCourseCheckUpdatesParametersTocheckInner
from poodle_async_full.models.core_course_check_updates_response import CoreCourseCheckUpdatesResponse
from poodle_async_full.models.core_course_create_categories_parameters_categories_inner import CoreCourseCreateCategoriesParametersCategoriesInner
from poodle_async_full.models.core_course_create_categories_response_inner import CoreCourseCreateCategoriesResponseInner
from poodle_async_full.models.core_course_create_courses_parameters_courses_inner import CoreCourseCreateCoursesParametersCoursesInner
from poodle_async_full.models.core_course_create_courses_response_inner import CoreCourseCreateCoursesResponseInner
from poodle_async_full.models.core_course_delete_categories_parameters_categories_inner import CoreCourseDeleteCategoriesParametersCategoriesInner
from poodle_async_full.models.core_course_delete_courses_response import CoreCourseDeleteCoursesResponse
from poodle_async_full.models.core_course_duplicate_course_parameters_options_inner import CoreCourseDuplicateCourseParametersOptionsInner
from poodle_async_full.models.core_course_duplicate_course_response import CoreCourseDuplicateCourseResponse
from poodle_async_full.models.core_course_get_activity_chooser_footer_response import CoreCourseGetActivityChooserFooterResponse
from poodle_async_full.models.core_course_get_categories_parameters_criteria_inner import CoreCourseGetCategoriesParametersCriteriaInner
from poodle_async_full.models.core_course_get_categories_response_inner import CoreCourseGetCategoriesResponseInner
from poodle_async_full.models.core_course_get_contents_parameters_options_inner import CoreCourseGetContentsParametersOptionsInner
from poodle_async_full.models.core_course_get_contents_response_inner import CoreCourseGetContentsResponseInner
from poodle_async_full.models.core_course_get_course_content_items_response import CoreCourseGetCourseContentItemsResponse
from poodle_async_full.models.core_course_get_course_module_by_instance_response import CoreCourseGetCourseModuleByInstanceResponse
from poodle_async_full.models.core_course_get_course_module_response import CoreCourseGetCourseModuleResponse
from poodle_async_full.models.core_course_get_courses_by_field_response import CoreCourseGetCoursesByFieldResponse
from poodle_async_full.models.core_course_get_courses_parameters_options import CoreCourseGetCoursesParametersOptions
from poodle_async_full.models.core_course_get_courses_response_inner import CoreCourseGetCoursesResponseInner
from poodle_async_full.models.core_course_get_enrolled_courses_by_timeline_classification_response import CoreCourseGetEnrolledCoursesByTimelineClassificationResponse
from poodle_async_full.models.core_course_get_enrolled_courses_with_action_events_by_timeline_classification_response import CoreCourseGetEnrolledCoursesWithActionEventsByTimelineClassificationResponse
from poodle_async_full.models.core_course_get_enrolled_users_by_cmid_response import CoreCourseGetEnrolledUsersByCmidResponse
from poodle_async_full.models.core_course_get_updates_since_response import CoreCourseGetUpdatesSinceResponse
from poodle_async_full.models.core_course_get_user_administration_options_response import CoreCourseGetUserAdministrationOptionsResponse
from poodle_async_full.models.core_course_get_user_navigation_options_response import CoreCourseGetUserNavigationOptionsResponse
from poodle_async_full.models.core_course_import_course_parameters_options_inner import CoreCourseImportCourseParametersOptionsInner
from poodle_async_full.models.core_course_remove_content_item_from_user_favourites_response import CoreCourseRemoveContentItemFromUserFavouritesResponse
from poodle_async_full.models.core_course_search_courses_response import CoreCourseSearchCoursesResponse
from poodle_async_full.models.core_course_set_favourite_courses_parameters_courses_inner import CoreCourseSetFavouriteCoursesParametersCoursesInner
from poodle_async_full.models.core_course_set_favourite_courses_response import CoreCourseSetFavouriteCoursesResponse
from poodle_async_full.models.core_course_toggle_activity_recommendation_response import CoreCourseToggleActivityRecommendationResponse
from poodle_async_full.models.core_course_update_categories_parameters_categories_inner import CoreCourseUpdateCategoriesParametersCategoriesInner
from poodle_async_full.models.core_course_update_courses_parameters_courses_inner import CoreCourseUpdateCoursesParametersCoursesInner
from poodle_async_full.models.core_course_update_courses_response import CoreCourseUpdateCoursesResponse
from poodle_async_full.models.core_course_view_course_response import CoreCourseViewCourseResponse
from poodle_async_full.models.core_courseformat_file_handlers_response_inner import CoreCourseformatFileHandlersResponseInner
from poodle_async_full.models.core_customfield_reload_template_response import CoreCustomfieldReloadTemplateResponse
from poodle_async_full.models.core_dynamic_tabs_get_content_response import CoreDynamicTabsGetContentResponse
from poodle_async_full.models.core_enrol_get_course_enrolment_methods_response_inner import CoreEnrolGetCourseEnrolmentMethodsResponseInner
from poodle_async_full.models.core_enrol_get_enrolled_users_parameters_options_inner import CoreEnrolGetEnrolledUsersParametersOptionsInner
from poodle_async_full.models.core_enrol_get_enrolled_users_response_inner import CoreEnrolGetEnrolledUsersResponseInner
from poodle_async_full.models.core_enrol_get_enrolled_users_with_capability_parameters_coursecapabilities_inner import CoreEnrolGetEnrolledUsersWithCapabilityParametersCoursecapabilitiesInner
from poodle_async_full.models.core_enrol_get_enrolled_users_with_capability_response_inner import CoreEnrolGetEnrolledUsersWithCapabilityResponseInner
from poodle_async_full.models.core_enrol_get_potential_users_response_inner import CoreEnrolGetPotentialUsersResponseInner
from poodle_async_full.models.core_enrol_get_users_courses_response_inner import CoreEnrolGetUsersCoursesResponseInner
from poodle_async_full.models.core_enrol_submit_user_enrolment_form_response import CoreEnrolSubmitUserEnrolmentFormResponse
from poodle_async_full.models.core_enrol_unenrol_user_enrolment_response import CoreEnrolUnenrolUserEnrolmentResponse
from poodle_async_full.models.core_fetch_notifications_parameters import CoreFetchNotificationsParameters
from poodle_async_full.models.core_fetch_notifications_response_inner import CoreFetchNotificationsResponseInner
from poodle_async_full.models.core_files_delete_draft_files_parameters_files_inner import CoreFilesDeleteDraftFilesParametersFilesInner
from poodle_async_full.models.core_files_delete_draft_files_response import CoreFilesDeleteDraftFilesResponse
from poodle_async_full.models.core_files_get_files_response import CoreFilesGetFilesResponse
from poodle_async_full.models.core_files_get_unused_draft_itemid_response import CoreFilesGetUnusedDraftItemidResponse
from poodle_async_full.models.core_files_upload_response import CoreFilesUploadResponse
from poodle_async_full.models.core_filters_get_all_states_response import CoreFiltersGetAllStatesResponse
from poodle_async_full.models.core_filters_get_available_in_context_parameters_contexts_inner import CoreFiltersGetAvailableInContextParametersContextsInner
from poodle_async_full.models.core_filters_get_available_in_context_response import CoreFiltersGetAvailableInContextResponse
from poodle_async_full.models.core_form_dynamic_form_response import CoreFormDynamicFormResponse
from poodle_async_full.models.core_form_get_filetypes_browser_data_parameters import CoreFormGetFiletypesBrowserDataParameters
from poodle_async_full.models.core_form_get_filetypes_browser_data_response import CoreFormGetFiletypesBrowserDataResponse
from poodle_async_full.models.core_get_component_strings_parameters import CoreGetComponentStringsParameters
from poodle_async_full.models.core_get_component_strings_response_inner import CoreGetComponentStringsResponseInner
from poodle_async_full.models.core_get_fragment_parameters_args_inner import CoreGetFragmentParametersArgsInner
from poodle_async_full.models.core_get_fragment_response import CoreGetFragmentResponse
from poodle_async_full.models.core_get_string_parameters import CoreGetStringParameters
from poodle_async_full.models.core_get_strings_parameters import CoreGetStringsParameters
from poodle_async_full.models.core_get_strings_response_inner import CoreGetStringsResponseInner
from poodle_async_full.models.core_get_user_dates_parameters_timestamps_inner import CoreGetUserDatesParametersTimestampsInner
from poodle_async_full.models.core_get_user_dates_response import CoreGetUserDatesResponse
from poodle_async_full.models.core_grades_create_gradecategories_parameters_categories_inner import CoreGradesCreateGradecategoriesParametersCategoriesInner
from poodle_async_full.models.core_grades_create_gradecategories_response import CoreGradesCreateGradecategoriesResponse
from poodle_async_full.models.core_grades_get_enrolled_users_for_selector_response import CoreGradesGetEnrolledUsersForSelectorResponse
from poodle_async_full.models.core_grades_get_feedback_response import CoreGradesGetFeedbackResponse
from poodle_async_full.models.core_grades_get_gradable_users_response import CoreGradesGetGradableUsersResponse
from poodle_async_full.models.core_grades_get_gradeitems_response import CoreGradesGetGradeitemsResponse
from poodle_async_full.models.core_grades_get_groups_for_selector_response import CoreGradesGetGroupsForSelectorResponse
from poodle_async_full.models.core_grades_grader_gradingpanel_point_fetch_response import CoreGradesGraderGradingpanelPointFetchResponse
from poodle_async_full.models.core_grades_grader_gradingpanel_point_store_response import CoreGradesGraderGradingpanelPointStoreResponse
from poodle_async_full.models.core_grades_grader_gradingpanel_scale_fetch_response import CoreGradesGraderGradingpanelScaleFetchResponse
from poodle_async_full.models.core_grades_grader_gradingpanel_scale_store_response import CoreGradesGraderGradingpanelScaleStoreResponse
from poodle_async_full.models.core_grades_update_grades_parameters_grades_inner import CoreGradesUpdateGradesParametersGradesInner
from poodle_async_full.models.core_grades_update_grades_parameters_itemdetails import CoreGradesUpdateGradesParametersItemdetails
from poodle_async_full.models.core_grading_get_definitions_response import CoreGradingGetDefinitionsResponse
from poodle_async_full.models.core_grading_get_definitions_response_areas_inner import CoreGradingGetDefinitionsResponseAreasInner
from poodle_async_full.models.core_grading_get_gradingform_instances_response import CoreGradingGetGradingformInstancesResponse
from poodle_async_full.models.core_group_add_group_members_parameters_members_inner import CoreGroupAddGroupMembersParametersMembersInner
from poodle_async_full.models.core_group_assign_grouping_parameters_assignments_inner import CoreGroupAssignGroupingParametersAssignmentsInner
from poodle_async_full.models.core_group_create_groupings_parameters_groupings_inner import CoreGroupCreateGroupingsParametersGroupingsInner
from poodle_async_full.models.core_group_create_groupings_response_inner import CoreGroupCreateGroupingsResponseInner
from poodle_async_full.models.core_group_create_groups_parameters_groups_inner import CoreGroupCreateGroupsParametersGroupsInner
from poodle_async_full.models.core_group_create_groups_response_inner import CoreGroupCreateGroupsResponseInner
from poodle_async_full.models.core_group_get_activity_allowed_groups_response import CoreGroupGetActivityAllowedGroupsResponse
from poodle_async_full.models.core_group_get_activity_groupmode_response import CoreGroupGetActivityGroupmodeResponse
from poodle_async_full.models.core_group_get_course_groupings_response_inner import CoreGroupGetCourseGroupingsResponseInner
from poodle_async_full.models.core_group_get_course_groups_response_inner import CoreGroupGetCourseGroupsResponseInner
from poodle_async_full.models.core_group_get_course_user_groups_response import CoreGroupGetCourseUserGroupsResponse
from poodle_async_full.models.core_group_get_group_members_response_inner import CoreGroupGetGroupMembersResponseInner
from poodle_async_full.models.core_group_get_groupings_response_inner import CoreGroupGetGroupingsResponseInner
from poodle_async_full.models.core_group_get_groups_for_selector_response import CoreGroupGetGroupsForSelectorResponse
from poodle_async_full.models.core_group_get_groups_response_inner import CoreGroupGetGroupsResponseInner
from poodle_async_full.models.core_group_update_groupings_parameters_groupings_inner import CoreGroupUpdateGroupingsParametersGroupingsInner
from poodle_async_full.models.core_group_update_groups_parameters_groups_inner import CoreGroupUpdateGroupsParametersGroupsInner
from poodle_async_full.models.core_h5p_get_trusted_h5p_file_response import CoreH5pGetTrustedH5pFileResponse
from poodle_async_full.models.core_message_create_contact_request_response import CoreMessageCreateContactRequestResponse
from poodle_async_full.models.core_message_data_for_messagearea_search_messages_response import CoreMessageDataForMessageareaSearchMessagesResponse
from poodle_async_full.models.core_message_delete_message_response import CoreMessageDeleteMessageResponse
from poodle_async_full.models.core_message_get_blocked_users_response import CoreMessageGetBlockedUsersResponse
from poodle_async_full.models.core_message_get_contact_requests_response_inner import CoreMessageGetContactRequestsResponseInner
from poodle_async_full.models.core_message_get_conversation_between_users_response import CoreMessageGetConversationBetweenUsersResponse
from poodle_async_full.models.core_message_get_conversation_between_users_response_messages_inner import CoreMessageGetConversationBetweenUsersResponseMessagesInner
from poodle_async_full.models.core_message_get_conversation_counts_response import CoreMessageGetConversationCountsResponse
from poodle_async_full.models.core_message_get_conversation_messages_response import CoreMessageGetConversationMessagesResponse
from poodle_async_full.models.core_message_get_conversation_response import CoreMessageGetConversationResponse
from poodle_async_full.models.core_message_get_conversations_response import CoreMessageGetConversationsResponse
from poodle_async_full.models.core_message_get_message_processor_response import CoreMessageGetMessageProcessorResponse
from poodle_async_full.models.core_message_get_messages_response import CoreMessageGetMessagesResponse
from poodle_async_full.models.core_message_get_self_conversation_response import CoreMessageGetSelfConversationResponse
from poodle_async_full.models.core_message_get_unread_conversation_counts_response import CoreMessageGetUnreadConversationCountsResponse
from poodle_async_full.models.core_message_get_unsent_message_response import CoreMessageGetUnsentMessageResponse
from poodle_async_full.models.core_message_get_user_message_preferences_response import CoreMessageGetUserMessagePreferencesResponse
from poodle_async_full.models.core_message_get_user_notification_preferences_response import CoreMessageGetUserNotificationPreferencesResponse
from poodle_async_full.models.core_message_mark_message_read_response import CoreMessageMarkMessageReadResponse
from poodle_async_full.models.core_message_mark_notification_read_response import CoreMessageMarkNotificationReadResponse
from poodle_async_full.models.core_message_message_processor_config_form_parameters_formvalues_inner import CoreMessageMessageProcessorConfigFormParametersFormvaluesInner
from poodle_async_full.models.core_message_message_search_users_response import CoreMessageMessageSearchUsersResponse
from poodle_async_full.models.core_message_search_contacts_response_inner import CoreMessageSearchContactsResponseInner
from poodle_async_full.models.core_message_send_instant_messages_parameters_messages_inner import CoreMessageSendInstantMessagesParametersMessagesInner
from poodle_async_full.models.core_message_send_instant_messages_response_inner import CoreMessageSendInstantMessagesResponseInner
from poodle_async_full.models.core_message_send_messages_to_conversation_parameters_messages_inner import CoreMessageSendMessagesToConversationParametersMessagesInner
from poodle_async_full.models.core_message_set_default_notification_response import CoreMessageSetDefaultNotificationResponse
from poodle_async_full.models.core_moodlenet_auth_check_response import CoreMoodlenetAuthCheckResponse
from poodle_async_full.models.core_moodlenet_get_share_info_activity_response import CoreMoodlenetGetShareInfoActivityResponse
from poodle_async_full.models.core_moodlenet_get_shared_course_info_response import CoreMoodlenetGetSharedCourseInfoResponse
from poodle_async_full.models.core_moodlenet_send_activity_response import CoreMoodlenetSendActivityResponse
from poodle_async_full.models.core_moodlenet_send_course_response import CoreMoodlenetSendCourseResponse
from poodle_async_full.models.core_my_view_page_response import CoreMyViewPageResponse
from poodle_async_full.models.core_notes_create_notes_parameters_notes_inner import CoreNotesCreateNotesParametersNotesInner
from poodle_async_full.models.core_notes_create_notes_response_inner import CoreNotesCreateNotesResponseInner
from poodle_async_full.models.core_notes_delete_notes_response_inner import CoreNotesDeleteNotesResponseInner
from poodle_async_full.models.core_notes_get_course_notes_response import CoreNotesGetCourseNotesResponse
from poodle_async_full.models.core_notes_get_notes_response import CoreNotesGetNotesResponse
from poodle_async_full.models.core_notes_update_notes_parameters_notes_inner import CoreNotesUpdateNotesParametersNotesInner
from poodle_async_full.models.core_notes_view_notes_response import CoreNotesViewNotesResponse
from poodle_async_full.models.core_output_load_fontawesome_icon_system_map_parameters import CoreOutputLoadFontawesomeIconSystemMapParameters
from poodle_async_full.models.core_output_load_fontawesome_icon_system_map_response_inner import CoreOutputLoadFontawesomeIconSystemMapResponseInner
from poodle_async_full.models.core_output_load_template_parameters import CoreOutputLoadTemplateParameters
from poodle_async_full.models.core_output_load_template_with_dependencies_parameters import CoreOutputLoadTemplateWithDependenciesParameters
from poodle_async_full.models.core_output_load_template_with_dependencies_response import CoreOutputLoadTemplateWithDependenciesResponse
from poodle_async_full.models.core_output_poll_stored_progress_response_inner import CoreOutputPollStoredProgressResponseInner
from poodle_async_full.models.core_payment_get_available_gateways_response_inner import CorePaymentGetAvailableGatewaysResponseInner
from poodle_async_full.models.core_question_get_random_question_summaries_response import CoreQuestionGetRandomQuestionSummariesResponse
from poodle_async_full.models.core_question_search_shared_banks_response import CoreQuestionSearchSharedBanksResponse
from poodle_async_full.models.core_question_update_flag_response import CoreQuestionUpdateFlagResponse
from poodle_async_full.models.core_rating_add_rating_response import CoreRatingAddRatingResponse
from poodle_async_full.models.core_rating_get_item_ratings_response import CoreRatingGetItemRatingsResponse
from poodle_async_full.models.core_reportbuilder_can_view_system_report_parameters_parameters_inner import CoreReportbuilderCanViewSystemReportParametersParametersInner
from poodle_async_full.models.core_reportbuilder_columns_add_response import CoreReportbuilderColumnsAddResponse
from poodle_async_full.models.core_reportbuilder_columns_delete_response import CoreReportbuilderColumnsDeleteResponse
from poodle_async_full.models.core_reportbuilder_columns_sort_get_response import CoreReportbuilderColumnsSortGetResponse
from poodle_async_full.models.core_reportbuilder_columns_sort_reorder_response import CoreReportbuilderColumnsSortReorderResponse
from poodle_async_full.models.core_reportbuilder_columns_sort_toggle_response import CoreReportbuilderColumnsSortToggleResponse
from poodle_async_full.models.core_reportbuilder_conditions_add_response import CoreReportbuilderConditionsAddResponse
from poodle_async_full.models.core_reportbuilder_conditions_delete_response import CoreReportbuilderConditionsDeleteResponse
from poodle_async_full.models.core_reportbuilder_conditions_reorder_response import CoreReportbuilderConditionsReorderResponse
from poodle_async_full.models.core_reportbuilder_conditions_reset_response import CoreReportbuilderConditionsResetResponse
from poodle_async_full.models.core_reportbuilder_filters_add_response import CoreReportbuilderFiltersAddResponse
from poodle_async_full.models.core_reportbuilder_filters_delete_response import CoreReportbuilderFiltersDeleteResponse
from poodle_async_full.models.core_reportbuilder_filters_reorder_response import CoreReportbuilderFiltersReorderResponse
from poodle_async_full.models.core_reportbuilder_list_reports_response import CoreReportbuilderListReportsResponse
from poodle_async_full.models.core_reportbuilder_reports_get_response import CoreReportbuilderReportsGetResponse
from poodle_async_full.models.core_reportbuilder_retrieve_report_response import CoreReportbuilderRetrieveReportResponse
from poodle_async_full.models.core_reportbuilder_retrieve_system_report_response import CoreReportbuilderRetrieveSystemReportResponse
from poodle_async_full.models.core_reportbuilder_view_report_response import CoreReportbuilderViewReportResponse
from poodle_async_full.models.core_role_assign_roles_parameters_assignments_inner import CoreRoleAssignRolesParametersAssignmentsInner
from poodle_async_full.models.core_role_unassign_roles_parameters_unassignments_inner import CoreRoleUnassignRolesParametersUnassignmentsInner
from poodle_async_full.models.core_search_get_relevant_users_response_inner import CoreSearchGetRelevantUsersResponseInner
from poodle_async_full.models.core_search_get_results_parameters_filters import CoreSearchGetResultsParametersFilters
from poodle_async_full.models.core_search_get_results_response import CoreSearchGetResultsResponse
from poodle_async_full.models.core_search_get_search_areas_list_response import CoreSearchGetSearchAreasListResponse
from poodle_async_full.models.core_search_get_top_results_response import CoreSearchGetTopResultsResponse
from poodle_async_full.models.core_search_view_results_parameters_filters import CoreSearchViewResultsParametersFilters
from poodle_async_full.models.core_search_view_results_response import CoreSearchViewResultsResponse
from poodle_async_full.models.core_session_time_remaining_response import CoreSessionTimeRemainingResponse
from poodle_async_full.models.core_sms_set_gateway_status_response import CoreSmsSetGatewayStatusResponse
from poodle_async_full.models.core_table_get_dynamic_table_content_parameters_filters_inner import CoreTableGetDynamicTableContentParametersFiltersInner
from poodle_async_full.models.core_table_get_dynamic_table_content_parameters_sortdata_inner import CoreTableGetDynamicTableContentParametersSortdataInner
from poodle_async_full.models.core_table_get_dynamic_table_content_response import CoreTableGetDynamicTableContentResponse
from poodle_async_full.models.core_tag_get_tag_areas_response import CoreTagGetTagAreasResponse
from poodle_async_full.models.core_tag_get_tag_cloud_response import CoreTagGetTagCloudResponse
from poodle_async_full.models.core_tag_get_tag_collections_response import CoreTagGetTagCollectionsResponse
from poodle_async_full.models.core_tag_get_tagindex_parameters_tagindex import CoreTagGetTagindexParametersTagindex
from poodle_async_full.models.core_tag_get_tagindex_per_area_parameters_tagindex import CoreTagGetTagindexPerAreaParametersTagindex
from poodle_async_full.models.core_tag_get_tagindex_per_area_response_inner import CoreTagGetTagindexPerAreaResponseInner
from poodle_async_full.models.core_tag_get_tagindex_response import CoreTagGetTagindexResponse
from poodle_async_full.models.core_tag_get_tags_parameters_tags_inner import CoreTagGetTagsParametersTagsInner
from poodle_async_full.models.core_tag_get_tags_response import CoreTagGetTagsResponse
from poodle_async_full.models.core_tag_update_tags_parameters_tags_inner import CoreTagUpdateTagsParametersTagsInner
from poodle_async_full.models.core_tag_update_tags_response import CoreTagUpdateTagsResponse
from poodle_async_full.models.core_update_inplace_editable_response import CoreUpdateInplaceEditableResponse
from poodle_async_full.models.core_user_agree_site_policy_response import CoreUserAgreeSitePolicyResponse
from poodle_async_full.models.core_user_create_users_parameters_users_inner import CoreUserCreateUsersParametersUsersInner
from poodle_async_full.models.core_user_create_users_response_inner import CoreUserCreateUsersResponseInner
from poodle_async_full.models.core_user_get_course_user_profiles_parameters_userlist_inner import CoreUserGetCourseUserProfilesParametersUserlistInner
from poodle_async_full.models.core_user_get_course_user_profiles_response_inner import CoreUserGetCourseUserProfilesResponseInner
from poodle_async_full.models.core_user_get_private_files_info_response import CoreUserGetPrivateFilesInfoResponse
from poodle_async_full.models.core_user_get_user_preferences_response import CoreUserGetUserPreferencesResponse
from poodle_async_full.models.core_user_get_users_parameters_criteria_inner import CoreUserGetUsersParametersCriteriaInner
from poodle_async_full.models.core_user_get_users_response import CoreUserGetUsersResponse
from poodle_async_full.models.core_user_prepare_private_files_for_edition_response import CoreUserPreparePrivateFilesForEditionResponse
from poodle_async_full.models.core_user_remove_user_device_response import CoreUserRemoveUserDeviceResponse
from poodle_async_full.models.core_user_search_identity_response import CoreUserSearchIdentityResponse
from poodle_async_full.models.core_user_search_identity_response_list_inner import CoreUserSearchIdentityResponseListInner
from poodle_async_full.models.core_user_set_user_preferences_parameters import CoreUserSetUserPreferencesParameters
from poodle_async_full.models.core_user_set_user_preferences_response import CoreUserSetUserPreferencesResponse
from poodle_async_full.models.core_user_update_picture_response import CoreUserUpdatePictureResponse
from poodle_async_full.models.core_user_update_private_files_response import CoreUserUpdatePrivateFilesResponse
from poodle_async_full.models.core_user_update_user_device_public_key_response import CoreUserUpdateUserDevicePublicKeyResponse
from poodle_async_full.models.core_user_update_user_preferences_parameters_preferences_inner import CoreUserUpdateUserPreferencesParametersPreferencesInner
from poodle_async_full.models.core_user_update_users_parameters_users_inner import CoreUserUpdateUsersParametersUsersInner
from poodle_async_full.models.core_user_update_users_response import CoreUserUpdateUsersResponse
from poodle_async_full.models.core_user_view_user_list_response import CoreUserViewUserListResponse
from poodle_async_full.models.core_user_view_user_profile_response import CoreUserViewUserProfileResponse
from poodle_async_full.models.core_webservice_get_site_info_response import CoreWebserviceGetSiteInfoResponse
from poodle_async_full.models.customfield_number_recalculate_value_response import CustomfieldNumberRecalculateValueResponse
from poodle_async_full.models.editor_tiny_get_configuration_response import EditorTinyGetConfigurationResponse
from poodle_async_full.models.enrol_guest_get_instance_info_response import EnrolGuestGetInstanceInfoResponse
from poodle_async_full.models.enrol_guest_validate_password_response import EnrolGuestValidatePasswordResponse
from poodle_async_full.models.enrol_manual_enrol_users_parameters_enrolments_inner import EnrolManualEnrolUsersParametersEnrolmentsInner
from poodle_async_full.models.enrol_manual_unenrol_users_parameters_enrolments_inner import EnrolManualUnenrolUsersParametersEnrolmentsInner
from poodle_async_full.models.enrol_meta_add_instances_parameters_instances_inner import EnrolMetaAddInstancesParametersInstancesInner
from poodle_async_full.models.enrol_meta_add_instances_response_inner import EnrolMetaAddInstancesResponseInner
from poodle_async_full.models.enrol_meta_delete_instances_parameters_instances_inner import EnrolMetaDeleteInstancesParametersInstancesInner
from poodle_async_full.models.enrol_meta_delete_instances_response_inner import EnrolMetaDeleteInstancesResponseInner
from poodle_async_full.models.enrol_self_enrol_user_response import EnrolSelfEnrolUserResponse
from poodle_async_full.models.enrol_self_get_instance_info_response import EnrolSelfGetInstanceInfoResponse
from poodle_async_full.models.gradereport_grader_get_users_in_report_response import GradereportGraderGetUsersInReportResponse
from poodle_async_full.models.gradereport_overview_get_course_grades_response import GradereportOverviewGetCourseGradesResponse
from poodle_async_full.models.gradereport_overview_view_grade_report_response import GradereportOverviewViewGradeReportResponse
from poodle_async_full.models.gradereport_singleview_get_grade_items_for_search_widget_response import GradereportSingleviewGetGradeItemsForSearchWidgetResponse
from poodle_async_full.models.gradereport_user_get_access_information_response import GradereportUserGetAccessInformationResponse
from poodle_async_full.models.gradereport_user_get_grade_items_response import GradereportUserGetGradeItemsResponse
from poodle_async_full.models.gradereport_user_get_grades_table_response import GradereportUserGetGradesTableResponse
from poodle_async_full.models.gradereport_user_view_grade_report_response import GradereportUserViewGradeReportResponse
from poodle_async_full.models.gradingform_guide_grader_gradingpanel_fetch_response import GradingformGuideGraderGradingpanelFetchResponse
from poodle_async_full.models.gradingform_guide_grader_gradingpanel_store_response import GradingformGuideGraderGradingpanelStoreResponse
from poodle_async_full.models.gradingform_rubric_grader_gradingpanel_fetch_response import GradingformRubricGraderGradingpanelFetchResponse
from poodle_async_full.models.gradingform_rubric_grader_gradingpanel_store_response import GradingformRubricGraderGradingpanelStoreResponse
from poodle_async_full.models.login_token200_response import LoginToken200Response
from poodle_async_full.models.media_videojs_get_language_parameters import MediaVideojsGetLanguageParameters
from poodle_async_full.models.message_airnotifier_are_notification_preferences_configured_response import MessageAirnotifierAreNotificationPreferencesConfiguredResponse
from poodle_async_full.models.message_airnotifier_enable_device_response import MessageAirnotifierEnableDeviceResponse
from poodle_async_full.models.message_airnotifier_get_user_devices_response import MessageAirnotifierGetUserDevicesResponse
from poodle_async_full.models.message_popup_get_popup_notifications_response import MessagePopupGetPopupNotificationsResponse
from poodle_async_full.models.mod_assign_get_assignments_response import ModAssignGetAssignmentsResponse
from poodle_async_full.models.mod_assign_get_grades_response import ModAssignGetGradesResponse
from poodle_async_full.models.mod_assign_get_participant_response import ModAssignGetParticipantResponse
from poodle_async_full.models.mod_assign_get_submission_status_response import ModAssignGetSubmissionStatusResponse
from poodle_async_full.models.mod_assign_get_submissions_response import ModAssignGetSubmissionsResponse
from poodle_async_full.models.mod_assign_get_user_flags_response import ModAssignGetUserFlagsResponse
from poodle_async_full.models.mod_assign_get_user_mappings_response import ModAssignGetUserMappingsResponse
from poodle_async_full.models.mod_assign_list_participants_response_inner import ModAssignListParticipantsResponseInner
from poodle_async_full.models.mod_assign_remove_submission_response import ModAssignRemoveSubmissionResponse
from poodle_async_full.models.mod_assign_save_grade_parameters_advancedgradingdata import ModAssignSaveGradeParametersAdvancedgradingdata
from poodle_async_full.models.mod_assign_save_grade_parameters_plugindata import ModAssignSaveGradeParametersPlugindata
from poodle_async_full.models.mod_assign_save_grades_parameters_grades_inner import ModAssignSaveGradesParametersGradesInner
from poodle_async_full.models.mod_assign_save_submission_parameters_plugindata import ModAssignSaveSubmissionParametersPlugindata
from poodle_async_full.models.mod_assign_set_user_flags_parameters_userflags_inner import ModAssignSetUserFlagsParametersUserflagsInner
from poodle_async_full.models.mod_assign_set_user_flags_response_inner import ModAssignSetUserFlagsResponseInner
from poodle_async_full.models.mod_assign_start_submission_response import ModAssignStartSubmissionResponse
from poodle_async_full.models.mod_assign_view_assign_response import ModAssignViewAssignResponse
from poodle_async_full.models.mod_assign_view_grading_table_response import ModAssignViewGradingTableResponse
from poodle_async_full.models.mod_assign_view_submission_status_response import ModAssignViewSubmissionStatusResponse
from poodle_async_full.models.mod_bigbluebuttonbn_can_join_response import ModBigbluebuttonbnCanJoinResponse
from poodle_async_full.models.mod_bigbluebuttonbn_completion_validate_response import ModBigbluebuttonbnCompletionValidateResponse
from poodle_async_full.models.mod_bigbluebuttonbn_end_meeting_response import ModBigbluebuttonbnEndMeetingResponse
from poodle_async_full.models.mod_bigbluebuttonbn_get_bigbluebuttonbns_by_courses_response import ModBigbluebuttonbnGetBigbluebuttonbnsByCoursesResponse
from poodle_async_full.models.mod_bigbluebuttonbn_get_join_url_response import ModBigbluebuttonbnGetJoinUrlResponse
from poodle_async_full.models.mod_bigbluebuttonbn_get_recordings_response import ModBigbluebuttonbnGetRecordingsResponse
from poodle_async_full.models.mod_bigbluebuttonbn_get_recordings_to_import_response import ModBigbluebuttonbnGetRecordingsToImportResponse
from poodle_async_full.models.mod_bigbluebuttonbn_meeting_info_response import ModBigbluebuttonbnMeetingInfoResponse
from poodle_async_full.models.mod_bigbluebuttonbn_view_bigbluebuttonbn_response import ModBigbluebuttonbnViewBigbluebuttonbnResponse
from poodle_async_full.models.mod_book_get_books_by_courses_response import ModBookGetBooksByCoursesResponse
from poodle_async_full.models.mod_book_view_book_response import ModBookViewBookResponse
from poodle_async_full.models.mod_choice_delete_choice_responses_response import ModChoiceDeleteChoiceResponsesResponse
from poodle_async_full.models.mod_choice_get_choice_options_response import ModChoiceGetChoiceOptionsResponse
from poodle_async_full.models.mod_choice_get_choice_results_response import ModChoiceGetChoiceResultsResponse
from poodle_async_full.models.mod_choice_get_choices_by_courses_response import ModChoiceGetChoicesByCoursesResponse
from poodle_async_full.models.mod_choice_submit_choice_response_response import ModChoiceSubmitChoiceResponseResponse
from poodle_async_full.models.mod_choice_view_choice_response import ModChoiceViewChoiceResponse
from poodle_async_full.models.mod_data_add_entry_parameters_data_inner import ModDataAddEntryParametersDataInner
from poodle_async_full.models.mod_data_add_entry_response import ModDataAddEntryResponse
from poodle_async_full.models.mod_data_approve_entry_response import ModDataApproveEntryResponse
from poodle_async_full.models.mod_data_delete_entry_response import ModDataDeleteEntryResponse
from poodle_async_full.models.mod_data_delete_saved_preset_response import ModDataDeleteSavedPresetResponse
from poodle_async_full.models.mod_data_get_data_access_information_response import ModDataGetDataAccessInformationResponse
from poodle_async_full.models.mod_data_get_databases_by_courses_response import ModDataGetDatabasesByCoursesResponse
from poodle_async_full.models.mod_data_get_entries_response import ModDataGetEntriesResponse
from poodle_async_full.models.mod_data_get_entry_response import ModDataGetEntryResponse
from poodle_async_full.models.mod_data_get_fields_response import ModDataGetFieldsResponse
from poodle_async_full.models.mod_data_get_mapping_information_response import ModDataGetMappingInformationResponse
from poodle_async_full.models.mod_data_search_entries_parameters_advsearch_inner import ModDataSearchEntriesParametersAdvsearchInner
from poodle_async_full.models.mod_data_search_entries_response import ModDataSearchEntriesResponse
from poodle_async_full.models.mod_data_update_entry_parameters_data_inner import ModDataUpdateEntryParametersDataInner
from poodle_async_full.models.mod_data_update_entry_response import ModDataUpdateEntryResponse
from poodle_async_full.models.mod_data_view_database_response import ModDataViewDatabaseResponse
from poodle_async_full.models.mod_feedback_get_analysis_response import ModFeedbackGetAnalysisResponse
from poodle_async_full.models.mod_feedback_get_current_completed_tmp_response import ModFeedbackGetCurrentCompletedTmpResponse
from poodle_async_full.models.mod_feedback_get_feedback_access_information_response import ModFeedbackGetFeedbackAccessInformationResponse
from poodle_async_full.models.mod_feedback_get_feedbacks_by_courses_response import ModFeedbackGetFeedbacksByCoursesResponse
from poodle_async_full.models.mod_feedback_get_finished_responses_response import ModFeedbackGetFinishedResponsesResponse
from poodle_async_full.models.mod_feedback_get_items_response import ModFeedbackGetItemsResponse
from poodle_async_full.models.mod_feedback_get_last_completed_response import ModFeedbackGetLastCompletedResponse
from poodle_async_full.models.mod_feedback_get_non_respondents_response import ModFeedbackGetNonRespondentsResponse
from poodle_async_full.models.mod_feedback_get_page_items_response import ModFeedbackGetPageItemsResponse
from poodle_async_full.models.mod_feedback_get_responses_analysis_response import ModFeedbackGetResponsesAnalysisResponse
from poodle_async_full.models.mod_feedback_get_unfinished_responses_response import ModFeedbackGetUnfinishedResponsesResponse
from poodle_async_full.models.mod_feedback_launch_feedback_response import ModFeedbackLaunchFeedbackResponse
from poodle_async_full.models.mod_feedback_process_page_parameters_responses_inner import ModFeedbackProcessPageParametersResponsesInner
from poodle_async_full.models.mod_feedback_process_page_response import ModFeedbackProcessPageResponse
from poodle_async_full.models.mod_feedback_view_feedback_response import ModFeedbackViewFeedbackResponse
from poodle_async_full.models.mod_folder_get_folders_by_courses_response import ModFolderGetFoldersByCoursesResponse
from poodle_async_full.models.mod_folder_view_folder_response import ModFolderViewFolderResponse
from poodle_async_full.models.mod_forum_add_discussion_parameters_options_inner import ModForumAddDiscussionParametersOptionsInner
from poodle_async_full.models.mod_forum_add_discussion_post_parameters_options_inner import ModForumAddDiscussionPostParametersOptionsInner
from poodle_async_full.models.mod_forum_add_discussion_post_response import ModForumAddDiscussionPostResponse
from poodle_async_full.models.mod_forum_add_discussion_response import ModForumAddDiscussionResponse
from poodle_async_full.models.mod_forum_can_add_discussion_response import ModForumCanAddDiscussionResponse
from poodle_async_full.models.mod_forum_delete_post_response import ModForumDeletePostResponse
from poodle_async_full.models.mod_forum_get_discussion_post_response import ModForumGetDiscussionPostResponse
from poodle_async_full.models.mod_forum_get_discussion_posts_by_userid_response import ModForumGetDiscussionPostsByUseridResponse
from poodle_async_full.models.mod_forum_get_discussion_posts_response import ModForumGetDiscussionPostsResponse
from poodle_async_full.models.mod_forum_get_forum_access_information_response import ModForumGetForumAccessInformationResponse
from poodle_async_full.models.mod_forum_get_forum_discussions_response import ModForumGetForumDiscussionsResponse
from poodle_async_full.models.mod_forum_get_forums_by_courses_response_inner import ModForumGetForumsByCoursesResponseInner
from poodle_async_full.models.mod_forum_prepare_draft_area_for_post_parameters_filestokeep_inner import ModForumPrepareDraftAreaForPostParametersFilestokeepInner
from poodle_async_full.models.mod_forum_prepare_draft_area_for_post_response import ModForumPrepareDraftAreaForPostResponse
from poodle_async_full.models.mod_forum_set_lock_state_response import ModForumSetLockStateResponse
from poodle_async_full.models.mod_forum_set_pin_state_response import ModForumSetPinStateResponse
from poodle_async_full.models.mod_forum_set_subscription_state_response import ModForumSetSubscriptionStateResponse
from poodle_async_full.models.mod_forum_toggle_favourite_state_response import ModForumToggleFavouriteStateResponse
from poodle_async_full.models.mod_forum_update_discussion_post_parameters_options_inner import ModForumUpdateDiscussionPostParametersOptionsInner
from poodle_async_full.models.mod_forum_update_discussion_post_response import ModForumUpdateDiscussionPostResponse
from poodle_async_full.models.mod_forum_view_forum_discussion_response import ModForumViewForumDiscussionResponse
from poodle_async_full.models.mod_forum_view_forum_response import ModForumViewForumResponse
from poodle_async_full.models.mod_glossary_add_entry_parameters_options_inner import ModGlossaryAddEntryParametersOptionsInner
from poodle_async_full.models.mod_glossary_add_entry_response import ModGlossaryAddEntryResponse
from poodle_async_full.models.mod_glossary_delete_entry_response import ModGlossaryDeleteEntryResponse
from poodle_async_full.models.mod_glossary_get_authors_parameters_options import ModGlossaryGetAuthorsParametersOptions
from poodle_async_full.models.mod_glossary_get_authors_response import ModGlossaryGetAuthorsResponse
from poodle_async_full.models.mod_glossary_get_categories_response import ModGlossaryGetCategoriesResponse
from poodle_async_full.models.mod_glossary_get_entries_by_author_id_parameters_options import ModGlossaryGetEntriesByAuthorIdParametersOptions
from poodle_async_full.models.mod_glossary_get_entries_by_author_id_response import ModGlossaryGetEntriesByAuthorIdResponse
from poodle_async_full.models.mod_glossary_get_entries_by_author_response import ModGlossaryGetEntriesByAuthorResponse
from poodle_async_full.models.mod_glossary_get_entries_by_category_response import ModGlossaryGetEntriesByCategoryResponse
from poodle_async_full.models.mod_glossary_get_entries_by_date_response import ModGlossaryGetEntriesByDateResponse
from poodle_async_full.models.mod_glossary_get_entries_by_letter_response import ModGlossaryGetEntriesByLetterResponse
from poodle_async_full.models.mod_glossary_get_entries_by_search_response import ModGlossaryGetEntriesBySearchResponse
from poodle_async_full.models.mod_glossary_get_entries_by_term_response import ModGlossaryGetEntriesByTermResponse
from poodle_async_full.models.mod_glossary_get_entries_to_approve_response import ModGlossaryGetEntriesToApproveResponse
from poodle_async_full.models.mod_glossary_get_entry_by_id_response import ModGlossaryGetEntryByIdResponse
from poodle_async_full.models.mod_glossary_get_glossaries_by_courses_response import ModGlossaryGetGlossariesByCoursesResponse
from poodle_async_full.models.mod_glossary_prepare_entry_for_edition_response import ModGlossaryPrepareEntryForEditionResponse
from poodle_async_full.models.mod_glossary_update_entry_response import ModGlossaryUpdateEntryResponse
from poodle_async_full.models.mod_glossary_view_entry_response import ModGlossaryViewEntryResponse
from poodle_async_full.models.mod_glossary_view_glossary_response import ModGlossaryViewGlossaryResponse
from poodle_async_full.models.mod_h5pactivity_get_attempts_response import ModH5pactivityGetAttemptsResponse
from poodle_async_full.models.mod_h5pactivity_get_h5pactivities_by_courses_response import ModH5pactivityGetH5pactivitiesByCoursesResponse
from poodle_async_full.models.mod_h5pactivity_get_h5pactivity_access_information_response import ModH5pactivityGetH5pactivityAccessInformationResponse
from poodle_async_full.models.mod_h5pactivity_get_results_response import ModH5pactivityGetResultsResponse
from poodle_async_full.models.mod_h5pactivity_get_user_attempts_response import ModH5pactivityGetUserAttemptsResponse
from poodle_async_full.models.mod_h5pactivity_log_report_viewed_response import ModH5pactivityLogReportViewedResponse
from poodle_async_full.models.mod_h5pactivity_view_h5pactivity_response import ModH5pactivityViewH5pactivityResponse
from poodle_async_full.models.mod_imscp_get_imscps_by_courses_response import ModImscpGetImscpsByCoursesResponse
from poodle_async_full.models.mod_imscp_view_imscp_response import ModImscpViewImscpResponse
from poodle_async_full.models.mod_label_get_labels_by_courses_response import ModLabelGetLabelsByCoursesResponse
from poodle_async_full.models.mod_lesson_finish_attempt_response import ModLessonFinishAttemptResponse
from poodle_async_full.models.mod_lesson_get_attempts_overview_response import ModLessonGetAttemptsOverviewResponse
from poodle_async_full.models.mod_lesson_get_content_pages_viewed_response import ModLessonGetContentPagesViewedResponse
from poodle_async_full.models.mod_lesson_get_lesson_access_information_response import ModLessonGetLessonAccessInformationResponse
from poodle_async_full.models.mod_lesson_get_lesson_response import ModLessonGetLessonResponse
from poodle_async_full.models.mod_lesson_get_lessons_by_courses_response import ModLessonGetLessonsByCoursesResponse
from poodle_async_full.models.mod_lesson_get_page_data_response import ModLessonGetPageDataResponse
from poodle_async_full.models.mod_lesson_get_pages_possible_jumps_response import ModLessonGetPagesPossibleJumpsResponse
from poodle_async_full.models.mod_lesson_get_pages_response import ModLessonGetPagesResponse
from poodle_async_full.models.mod_lesson_get_questions_attempts_response import ModLessonGetQuestionsAttemptsResponse
from poodle_async_full.models.mod_lesson_get_user_attempt_grade_response import ModLessonGetUserAttemptGradeResponse
from poodle_async_full.models.mod_lesson_get_user_attempt_response import ModLessonGetUserAttemptResponse
from poodle_async_full.models.mod_lesson_get_user_grade_response import ModLessonGetUserGradeResponse
from poodle_async_full.models.mod_lesson_get_user_timers_response import ModLessonGetUserTimersResponse
from poodle_async_full.models.mod_lesson_launch_attempt_response import ModLessonLaunchAttemptResponse
from poodle_async_full.models.mod_lesson_process_page_parameters_data_inner import ModLessonProcessPageParametersDataInner
from poodle_async_full.models.mod_lesson_process_page_response import ModLessonProcessPageResponse
from poodle_async_full.models.mod_lesson_view_lesson_response import ModLessonViewLessonResponse
from poodle_async_full.models.mod_lti_create_tool_proxy_response import ModLtiCreateToolProxyResponse
from poodle_async_full.models.mod_lti_create_tool_type_response import ModLtiCreateToolTypeResponse
from poodle_async_full.models.mod_lti_delete_tool_proxy_response import ModLtiDeleteToolProxyResponse
from poodle_async_full.models.mod_lti_delete_tool_type_response import ModLtiDeleteToolTypeResponse
from poodle_async_full.models.mod_lti_get_ltis_by_courses_response import ModLtiGetLtisByCoursesResponse
from poodle_async_full.models.mod_lti_get_tool_launch_data_response import ModLtiGetToolLaunchDataResponse
from poodle_async_full.models.mod_lti_get_tool_proxies_response_inner import ModLtiGetToolProxiesResponseInner
from poodle_async_full.models.mod_lti_get_tool_proxy_registration_request_response import ModLtiGetToolProxyRegistrationRequestResponse
from poodle_async_full.models.mod_lti_get_tool_types_and_proxies_count_response import ModLtiGetToolTypesAndProxiesCountResponse
from poodle_async_full.models.mod_lti_get_tool_types_and_proxies_response import ModLtiGetToolTypesAndProxiesResponse
from poodle_async_full.models.mod_lti_get_tool_types_and_proxies_response_types_inner import ModLtiGetToolTypesAndProxiesResponseTypesInner
from poodle_async_full.models.mod_lti_is_cartridge_response import ModLtiIsCartridgeResponse
from poodle_async_full.models.mod_lti_update_tool_type_response import ModLtiUpdateToolTypeResponse
from poodle_async_full.models.mod_lti_view_lti_response import ModLtiViewLtiResponse
from poodle_async_full.models.mod_page_get_pages_by_courses_response import ModPageGetPagesByCoursesResponse
from poodle_async_full.models.mod_page_view_page_response import ModPageViewPageResponse
from poodle_async_full.models.mod_quiz_add_random_questions_response import ModQuizAddRandomQuestionsResponse
from poodle_async_full.models.mod_quiz_create_grade_items_parameters_quizgradeitems_inner import ModQuizCreateGradeItemsParametersQuizgradeitemsInner
from poodle_async_full.models.mod_quiz_delete_grade_items_parameters_quizgradeitems_inner import ModQuizDeleteGradeItemsParametersQuizgradeitemsInner
from poodle_async_full.models.mod_quiz_delete_overrides_parameters_data import ModQuizDeleteOverridesParametersData
from poodle_async_full.models.mod_quiz_delete_overrides_response import ModQuizDeleteOverridesResponse
from poodle_async_full.models.mod_quiz_get_attempt_access_information_response import ModQuizGetAttemptAccessInformationResponse
from poodle_async_full.models.mod_quiz_get_attempt_data_response import ModQuizGetAttemptDataResponse
from poodle_async_full.models.mod_quiz_get_attempt_review_response import ModQuizGetAttemptReviewResponse
from poodle_async_full.models.mod_quiz_get_attempt_summary_response import ModQuizGetAttemptSummaryResponse
from poodle_async_full.models.mod_quiz_get_combined_review_options_response import ModQuizGetCombinedReviewOptionsResponse
from poodle_async_full.models.mod_quiz_get_overrides_response import ModQuizGetOverridesResponse
from poodle_async_full.models.mod_quiz_get_quiz_access_information_response import ModQuizGetQuizAccessInformationResponse
from poodle_async_full.models.mod_quiz_get_quiz_feedback_for_grade_response import ModQuizGetQuizFeedbackForGradeResponse
from poodle_async_full.models.mod_quiz_get_quiz_required_qtypes_response import ModQuizGetQuizRequiredQtypesResponse
from poodle_async_full.models.mod_quiz_get_quizzes_by_courses_response import ModQuizGetQuizzesByCoursesResponse
from poodle_async_full.models.mod_quiz_get_user_attempts_response import ModQuizGetUserAttemptsResponse
from poodle_async_full.models.mod_quiz_get_user_best_grade_response import ModQuizGetUserBestGradeResponse
from poodle_async_full.models.mod_quiz_get_user_quiz_attempts_response import ModQuizGetUserQuizAttemptsResponse
from poodle_async_full.models.mod_quiz_process_attempt_response import ModQuizProcessAttemptResponse
from poodle_async_full.models.mod_quiz_save_attempt_response import ModQuizSaveAttemptResponse
from poodle_async_full.models.mod_quiz_save_overrides_parameters_data import ModQuizSaveOverridesParametersData
from poodle_async_full.models.mod_quiz_save_overrides_response import ModQuizSaveOverridesResponse
from poodle_async_full.models.mod_quiz_set_question_version_response import ModQuizSetQuestionVersionResponse
from poodle_async_full.models.mod_quiz_start_attempt_response import ModQuizStartAttemptResponse
from poodle_async_full.models.mod_quiz_update_filter_condition_response import ModQuizUpdateFilterConditionResponse
from poodle_async_full.models.mod_quiz_update_grade_items_parameters_quizgradeitems_inner import ModQuizUpdateGradeItemsParametersQuizgradeitemsInner
from poodle_async_full.models.mod_quiz_update_slots_parameters_slots_inner import ModQuizUpdateSlotsParametersSlotsInner
from poodle_async_full.models.mod_quiz_view_attempt_response import ModQuizViewAttemptResponse
from poodle_async_full.models.mod_quiz_view_attempt_review_response import ModQuizViewAttemptReviewResponse
from poodle_async_full.models.mod_quiz_view_attempt_summary_response import ModQuizViewAttemptSummaryResponse
from poodle_async_full.models.mod_quiz_view_quiz_response import ModQuizViewQuizResponse
from poodle_async_full.models.mod_resource_get_resources_by_courses_response import ModResourceGetResourcesByCoursesResponse
from poodle_async_full.models.mod_resource_view_resource_response import ModResourceViewResourceResponse
from poodle_async_full.models.mod_scorm_get_scorm_access_information_response import ModScormGetScormAccessInformationResponse
from poodle_async_full.models.mod_scorm_get_scorm_attempt_count_response import ModScormGetScormAttemptCountResponse
from poodle_async_full.models.mod_scorm_get_scorm_sco_tracks_response import ModScormGetScormScoTracksResponse
from poodle_async_full.models.mod_scorm_get_scorm_scoes_response import ModScormGetScormScoesResponse
from poodle_async_full.models.mod_scorm_get_scorm_scoes_response_scoes_inner_extradata_inner import ModScormGetScormScoesResponseScoesInnerExtradataInner
from poodle_async_full.models.mod_scorm_get_scorm_user_data_response import ModScormGetScormUserDataResponse
from poodle_async_full.models.mod_scorm_get_scorms_by_courses_response import ModScormGetScormsByCoursesResponse
from poodle_async_full.models.mod_scorm_insert_scorm_tracks_response import ModScormInsertScormTracksResponse
from poodle_async_full.models.mod_scorm_launch_sco_response import ModScormLaunchScoResponse
from poodle_async_full.models.mod_scorm_view_scorm_response import ModScormViewScormResponse
from poodle_async_full.models.mod_url_get_urls_by_courses_response import ModUrlGetUrlsByCoursesResponse
from poodle_async_full.models.mod_url_view_url_response import ModUrlViewUrlResponse
from poodle_async_full.models.mod_wiki_edit_page_response import ModWikiEditPageResponse
from poodle_async_full.models.mod_wiki_get_page_contents_response import ModWikiGetPageContentsResponse
from poodle_async_full.models.mod_wiki_get_page_for_editing_response import ModWikiGetPageForEditingResponse
from poodle_async_full.models.mod_wiki_get_subwiki_files_response import ModWikiGetSubwikiFilesResponse
from poodle_async_full.models.mod_wiki_get_subwiki_pages_parameters_options import ModWikiGetSubwikiPagesParametersOptions
from poodle_async_full.models.mod_wiki_get_subwiki_pages_response import ModWikiGetSubwikiPagesResponse
from poodle_async_full.models.mod_wiki_get_subwikis_response import ModWikiGetSubwikisResponse
from poodle_async_full.models.mod_wiki_get_wikis_by_courses_response import ModWikiGetWikisByCoursesResponse
from poodle_async_full.models.mod_wiki_new_page_response import ModWikiNewPageResponse
from poodle_async_full.models.mod_wiki_view_page_response import ModWikiViewPageResponse
from poodle_async_full.models.mod_wiki_view_wiki_response import ModWikiViewWikiResponse
from poodle_async_full.models.mod_workshop_add_submission_response import ModWorkshopAddSubmissionResponse
from poodle_async_full.models.mod_workshop_delete_submission_response import ModWorkshopDeleteSubmissionResponse
from poodle_async_full.models.mod_workshop_evaluate_assessment_response import ModWorkshopEvaluateAssessmentResponse
from poodle_async_full.models.mod_workshop_evaluate_submission_response import ModWorkshopEvaluateSubmissionResponse
from poodle_async_full.models.mod_workshop_get_assessment_form_definition_response import ModWorkshopGetAssessmentFormDefinitionResponse
from poodle_async_full.models.mod_workshop_get_assessment_response import ModWorkshopGetAssessmentResponse
from poodle_async_full.models.mod_workshop_get_grades_report_response import ModWorkshopGetGradesReportResponse
from poodle_async_full.models.mod_workshop_get_grades_response import ModWorkshopGetGradesResponse
from poodle_async_full.models.mod_workshop_get_reviewer_assessments_response import ModWorkshopGetReviewerAssessmentsResponse
from poodle_async_full.models.mod_workshop_get_submission_assessments_response import ModWorkshopGetSubmissionAssessmentsResponse
from poodle_async_full.models.mod_workshop_get_submission_response import ModWorkshopGetSubmissionResponse
from poodle_async_full.models.mod_workshop_get_submissions_response import ModWorkshopGetSubmissionsResponse
from poodle_async_full.models.mod_workshop_get_user_plan_response import ModWorkshopGetUserPlanResponse
from poodle_async_full.models.mod_workshop_get_workshop_access_information_response import ModWorkshopGetWorkshopAccessInformationResponse
from poodle_async_full.models.mod_workshop_get_workshops_by_courses_response import ModWorkshopGetWorkshopsByCoursesResponse
from poodle_async_full.models.mod_workshop_update_assessment_parameters_data_inner import ModWorkshopUpdateAssessmentParametersDataInner
from poodle_async_full.models.mod_workshop_update_assessment_response import ModWorkshopUpdateAssessmentResponse
from poodle_async_full.models.mod_workshop_update_submission_response import ModWorkshopUpdateSubmissionResponse
from poodle_async_full.models.mod_workshop_view_submission_response import ModWorkshopViewSubmissionResponse
from poodle_async_full.models.mod_workshop_view_workshop_response import ModWorkshopViewWorkshopResponse
from poodle_async_full.models.paygw_paypal_create_transaction_complete_parameters import PaygwPaypalCreateTransactionCompleteParameters
from poodle_async_full.models.paygw_paypal_create_transaction_complete_response import PaygwPaypalCreateTransactionCompleteResponse
from poodle_async_full.models.paygw_paypal_get_config_for_js_response import PaygwPaypalGetConfigForJsResponse
from poodle_async_full.models.qbank_editquestion_set_status_response import QbankEditquestionSetStatusResponse
from poodle_async_full.models.qbank_managecategories_move_category_response_inner import QbankManagecategoriesMoveCategoryResponseInner
from poodle_async_full.models.qbank_tagquestion_submit_tags_form_response import QbankTagquestionSubmitTagsFormResponse
from poodle_async_full.models.quizaccess_seb_validate_quiz_keys_response import QuizaccessSebValidateQuizKeysResponse
from poodle_async_full.models.report_competency_data_for_report_response import ReportCompetencyDataForReportResponse
from poodle_async_full.models.report_insights_action_executed_response import ReportInsightsActionExecutedResponse
from poodle_async_full.models.tiny_autosave_reset_session_parameters import TinyAutosaveResetSessionParameters
from poodle_async_full.models.tiny_autosave_resume_session_parameters import TinyAutosaveResumeSessionParameters
from poodle_async_full.models.tiny_autosave_resume_session_response import TinyAutosaveResumeSessionResponse
from poodle_async_full.models.tiny_autosave_update_session_parameters import TinyAutosaveUpdateSessionParameters
from poodle_async_full.models.tiny_equation_filter_response import TinyEquationFilterResponse
from poodle_async_full.models.tiny_media_preview_response import TinyMediaPreviewResponse
from poodle_async_full.models.tiny_premium_get_api_key_response import TinyPremiumGetApiKeyResponse
from poodle_async_full.models.tool_analytics_potential_contexts_response_inner import ToolAnalyticsPotentialContextsResponseInner
from poodle_async_full.models.tool_behat_get_entity_generator_response import ToolBehatGetEntityGeneratorResponse
from poodle_async_full.models.tool_dataprivacy_approve_data_request_response import ToolDataprivacyApproveDataRequestResponse
from poodle_async_full.models.tool_dataprivacy_bulk_approve_data_requests_response import ToolDataprivacyBulkApproveDataRequestsResponse
from poodle_async_full.models.tool_dataprivacy_bulk_deny_data_requests_response import ToolDataprivacyBulkDenyDataRequestsResponse
from poodle_async_full.models.tool_dataprivacy_cancel_data_request_response import ToolDataprivacyCancelDataRequestResponse
from poodle_async_full.models.tool_dataprivacy_confirm_contexts_for_deletion_response import ToolDataprivacyConfirmContextsForDeletionResponse
from poodle_async_full.models.tool_dataprivacy_contact_dpo_response import ToolDataprivacyContactDpoResponse
from poodle_async_full.models.tool_dataprivacy_create_category_form_response import ToolDataprivacyCreateCategoryFormResponse
from poodle_async_full.models.tool_dataprivacy_create_data_request_response import ToolDataprivacyCreateDataRequestResponse
from poodle_async_full.models.tool_dataprivacy_create_purpose_form_response import ToolDataprivacyCreatePurposeFormResponse
from poodle_async_full.models.tool_dataprivacy_delete_category_response import ToolDataprivacyDeleteCategoryResponse
from poodle_async_full.models.tool_dataprivacy_delete_purpose_response import ToolDataprivacyDeletePurposeResponse
from poodle_async_full.models.tool_dataprivacy_deny_data_request_response import ToolDataprivacyDenyDataRequestResponse
from poodle_async_full.models.tool_dataprivacy_get_access_information_response import ToolDataprivacyGetAccessInformationResponse
from poodle_async_full.models.tool_dataprivacy_get_activity_options_response import ToolDataprivacyGetActivityOptionsResponse
from poodle_async_full.models.tool_dataprivacy_get_category_options_response import ToolDataprivacyGetCategoryOptionsResponse
from poodle_async_full.models.tool_dataprivacy_get_data_request_response import ToolDataprivacyGetDataRequestResponse
from poodle_async_full.models.tool_dataprivacy_get_data_requests_response import ToolDataprivacyGetDataRequestsResponse
from poodle_async_full.models.tool_dataprivacy_get_purpose_options_response import ToolDataprivacyGetPurposeOptionsResponse
from poodle_async_full.models.tool_dataprivacy_mark_complete_response import ToolDataprivacyMarkCompleteResponse
from poodle_async_full.models.tool_dataprivacy_set_context_defaults_response import ToolDataprivacySetContextDefaultsResponse
from poodle_async_full.models.tool_dataprivacy_set_context_form_response import ToolDataprivacySetContextFormResponse
from poodle_async_full.models.tool_dataprivacy_set_contextlevel_form_response import ToolDataprivacySetContextlevelFormResponse
from poodle_async_full.models.tool_dataprivacy_submit_selected_courses_form_response import ToolDataprivacySubmitSelectedCoursesFormResponse
from poodle_async_full.models.tool_dataprivacy_tree_extra_branches_response import ToolDataprivacyTreeExtraBranchesResponse
from poodle_async_full.models.tool_lp_data_for_competencies_manage_page_response import ToolLpDataForCompetenciesManagePageResponse
from poodle_async_full.models.tool_lp_data_for_competency_frameworks_manage_page_response import ToolLpDataForCompetencyFrameworksManagePageResponse
from poodle_async_full.models.tool_lp_data_for_competency_summary_response import ToolLpDataForCompetencySummaryResponse
from poodle_async_full.models.tool_lp_data_for_course_competencies_page_response import ToolLpDataForCourseCompetenciesPageResponse
from poodle_async_full.models.tool_lp_data_for_plan_page_response import ToolLpDataForPlanPageResponse
from poodle_async_full.models.tool_lp_data_for_plans_page_response import ToolLpDataForPlansPageResponse
from poodle_async_full.models.tool_lp_data_for_related_competencies_section_response import ToolLpDataForRelatedCompetenciesSectionResponse
from poodle_async_full.models.tool_lp_data_for_template_competencies_page_response import ToolLpDataForTemplateCompetenciesPageResponse
from poodle_async_full.models.tool_lp_data_for_templates_manage_page_response import ToolLpDataForTemplatesManagePageResponse
from poodle_async_full.models.tool_lp_data_for_user_competency_summary_in_course_response import ToolLpDataForUserCompetencySummaryInCourseResponse
from poodle_async_full.models.tool_lp_data_for_user_competency_summary_in_plan_response import ToolLpDataForUserCompetencySummaryInPlanResponse
from poodle_async_full.models.tool_lp_data_for_user_competency_summary_response import ToolLpDataForUserCompetencySummaryResponse
from poodle_async_full.models.tool_lp_data_for_user_evidence_list_page_response import ToolLpDataForUserEvidenceListPageResponse
from poodle_async_full.models.tool_lp_data_for_user_evidence_page_response import ToolLpDataForUserEvidencePageResponse
from poodle_async_full.models.tool_lp_search_cohorts_response import ToolLpSearchCohortsResponse
from poodle_async_full.models.tool_lp_search_users_response import ToolLpSearchUsersResponse
from poodle_async_full.models.tool_mobile_call_external_functions_parameters_requests_inner import ToolMobileCallExternalFunctionsParametersRequestsInner
from poodle_async_full.models.tool_mobile_call_external_functions_response import ToolMobileCallExternalFunctionsResponse
from poodle_async_full.models.tool_mobile_get_autologin_key_response import ToolMobileGetAutologinKeyResponse
from poodle_async_full.models.tool_mobile_get_config_response import ToolMobileGetConfigResponse
from poodle_async_full.models.tool_mobile_get_content_parameters_args_inner import ToolMobileGetContentParametersArgsInner
from poodle_async_full.models.tool_mobile_get_content_response import ToolMobileGetContentResponse
from poodle_async_full.models.tool_mobile_get_plugins_supporting_mobile_response import ToolMobileGetPluginsSupportingMobileResponse
from poodle_async_full.models.tool_mobile_get_public_config_response import ToolMobileGetPublicConfigResponse
from poodle_async_full.models.tool_mobile_get_tokens_for_qr_login_parameters import ToolMobileGetTokensForQrLoginParameters
from poodle_async_full.models.tool_mobile_get_tokens_for_qr_login_response import ToolMobileGetTokensForQrLoginResponse
from poodle_async_full.models.tool_mobile_validate_subscription_key_parameters import ToolMobileValidateSubscriptionKeyParameters
from poodle_async_full.models.tool_mobile_validate_subscription_key_response import ToolMobileValidateSubscriptionKeyResponse
from poodle_async_full.models.tool_moodlenet_search_courses_response import ToolMoodlenetSearchCoursesResponse
from poodle_async_full.models.tool_moodlenet_verify_webfinger_response import ToolMoodlenetVerifyWebfingerResponse
from poodle_async_full.models.tool_policy_get_policy_version_parameters import ToolPolicyGetPolicyVersionParameters
from poodle_async_full.models.tool_policy_get_policy_version_response import ToolPolicyGetPolicyVersionResponse
from poodle_async_full.models.tool_policy_get_user_acceptances_response import ToolPolicyGetUserAcceptancesResponse
from poodle_async_full.models.tool_policy_set_acceptances_status_parameters_policies_inner import ToolPolicySetAcceptancesStatusParametersPoliciesInner
from poodle_async_full.models.tool_policy_set_acceptances_status_response import ToolPolicySetAcceptancesStatusResponse
from poodle_async_full.models.tool_templatelibrary_list_templates_parameters import ToolTemplatelibraryListTemplatesParameters
from poodle_async_full.models.tool_templatelibrary_load_canonical_template_parameters import ToolTemplatelibraryLoadCanonicalTemplateParameters
from poodle_async_full.models.tool_usertours_fetch_and_start_tour_response import ToolUsertoursFetchAndStartTourResponse
from poodle_async_full.models.tool_usertours_reset_tour_response import ToolUsertoursResetTourResponse

from poodle_async_full.api_client import ApiClient, RequestSerialized
from poodle_async_full.api_response import ApiResponse
from poodle_async_full.rest import RESTResponseType
from poodle_async_full.exceptions import ApiException


def fix_file_url(url: str, token: str) -> str:
    return re.sub(
        r"(\/webservice)?\/pluginfile\.php", f"/tokenpluginfile.php/{token}", url
    )

def is_primitive(value: Any):
    return isinstance(value, (int, float, str, bool))


def is_collection(value: Any):
    return isinstance(value, (set, list))


def _parse_form(data: Any, prefix: str = "") -> List[Tuple[str, str]]:
    if data is None:
        return []
    if is_primitive(data):
        value = int(data) if isinstance(data, bool) else str(data)
        return [(prefix, value)]
    result: List[Tuple[str, str]] = []
    if is_collection(data):
        for i, value in enumerate(data):
            result = result + _parse_form(
                value, prefix + (f"{i}" if prefix == "" else f"[{i}]")
            )
    else:
        dictionary = data.__dict__ if hasattr(data, "__dict__") else data
        for key in dictionary.keys():
            value = dictionary[key]
            result = result + _parse_form(
                value, prefix + (f"{key}" if prefix == "" else f"[{key}]")
            )
    return result


def parse_form(data: Dict[str, Any]):
    return _parse_form(data)


class DefaultApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client


    async def get_file(self, url, userprivateaccesskey: Optional[str]=None):
        if userprivateaccesskey is None and hasattr(self, "core_webservice_get_site_info"):
            userprivateaccesskey = (await self.core_webservice_get_site_info()).userprivateaccesskey
        if userprivateaccesskey is None:
            raise ApiException("Current site is missing userprivateaccesskey")
        return await self.api_client.call_api(
            method="GET", url=fix_file_url(url, userprivateaccesskey)
        )


    @validate_call
    def aiplacement_courseassist_explain_text_args(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        prompttext: Annotated[Optional[StrictStr], Field(description="The prompt text for the AI service")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Explain text for the Course Assistance Placement

        Explain text for the Course Assistance Placement

        :param contextid: The context ID (required)
        :type contextid: int
        :param prompttext: The prompt text for the AI service (required)
        :type prompttext: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._aiplacement_courseassist_explain_text_serialize(
            contextid=contextid,
            prompttext=prompttext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementCourseassistExplainTextResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def aiplacement_courseassist_explain_text(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        prompttext: Annotated[Optional[StrictStr], Field(description="The prompt text for the AI service")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> AiplacementCourseassistExplainTextResponse:
        """Explain text for the Course Assistance Placement

        Explain text for the Course Assistance Placement

        :param contextid: The context ID (required)
        :type contextid: int
        :param prompttext: The prompt text for the AI service (required)
        :type prompttext: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._aiplacement_courseassist_explain_text_serialize(
            contextid=contextid,
            prompttext=prompttext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementCourseassistExplainTextResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def aiplacement_courseassist_explain_text_from_args(
        self,
        args
    ) -> AiplacementCourseassistExplainTextResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementCourseassistExplainTextResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def aiplacement_courseassist_explain_text_with_http_info(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        prompttext: Annotated[Optional[StrictStr], Field(description="The prompt text for the AI service")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[AiplacementCourseassistExplainTextResponse]:
        """Explain text for the Course Assistance Placement

        Explain text for the Course Assistance Placement

        :param contextid: The context ID (required)
        :type contextid: int
        :param prompttext: The prompt text for the AI service (required)
        :type prompttext: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._aiplacement_courseassist_explain_text_serialize(
            contextid=contextid,
            prompttext=prompttext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementCourseassistExplainTextResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def aiplacement_courseassist_explain_text_without_preload_content(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        prompttext: Annotated[Optional[StrictStr], Field(description="The prompt text for the AI service")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Explain text for the Course Assistance Placement

        Explain text for the Course Assistance Placement

        :param contextid: The context ID (required)
        :type contextid: int
        :param prompttext: The prompt text for the AI service (required)
        :type prompttext: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._aiplacement_courseassist_explain_text_serialize(
            contextid=contextid,
            prompttext=prompttext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementCourseassistExplainTextResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _aiplacement_courseassist_explain_text_serialize(
        self,
        contextid,
        prompttext,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#aiplacement_courseassist_explain_text'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'aiplacement_courseassist_explain_text'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'aiplacement_courseassist_explain_text',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if prompttext is not None:
            _form_params += parse_form({'prompttext': prompttext})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def aiplacement_courseassist_summarise_text_args(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        prompttext: Annotated[Optional[StrictStr], Field(description="The prompt text for the AI service")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Summarise text for the Course Assistance Placement

        Summarise text for the Course Assistance Placement

        :param contextid: The context ID (required)
        :type contextid: int
        :param prompttext: The prompt text for the AI service (required)
        :type prompttext: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._aiplacement_courseassist_summarise_text_serialize(
            contextid=contextid,
            prompttext=prompttext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementCourseassistSummariseTextResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def aiplacement_courseassist_summarise_text(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        prompttext: Annotated[Optional[StrictStr], Field(description="The prompt text for the AI service")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> AiplacementCourseassistSummariseTextResponse:
        """Summarise text for the Course Assistance Placement

        Summarise text for the Course Assistance Placement

        :param contextid: The context ID (required)
        :type contextid: int
        :param prompttext: The prompt text for the AI service (required)
        :type prompttext: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._aiplacement_courseassist_summarise_text_serialize(
            contextid=contextid,
            prompttext=prompttext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementCourseassistSummariseTextResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def aiplacement_courseassist_summarise_text_from_args(
        self,
        args
    ) -> AiplacementCourseassistSummariseTextResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementCourseassistSummariseTextResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def aiplacement_courseassist_summarise_text_with_http_info(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        prompttext: Annotated[Optional[StrictStr], Field(description="The prompt text for the AI service")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[AiplacementCourseassistSummariseTextResponse]:
        """Summarise text for the Course Assistance Placement

        Summarise text for the Course Assistance Placement

        :param contextid: The context ID (required)
        :type contextid: int
        :param prompttext: The prompt text for the AI service (required)
        :type prompttext: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._aiplacement_courseassist_summarise_text_serialize(
            contextid=contextid,
            prompttext=prompttext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementCourseassistSummariseTextResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def aiplacement_courseassist_summarise_text_without_preload_content(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        prompttext: Annotated[Optional[StrictStr], Field(description="The prompt text for the AI service")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Summarise text for the Course Assistance Placement

        Summarise text for the Course Assistance Placement

        :param contextid: The context ID (required)
        :type contextid: int
        :param prompttext: The prompt text for the AI service (required)
        :type prompttext: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._aiplacement_courseassist_summarise_text_serialize(
            contextid=contextid,
            prompttext=prompttext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementCourseassistSummariseTextResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _aiplacement_courseassist_summarise_text_serialize(
        self,
        contextid,
        prompttext,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#aiplacement_courseassist_summarise_text'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'aiplacement_courseassist_summarise_text'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'aiplacement_courseassist_summarise_text',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if prompttext is not None:
            _form_params += parse_form({'prompttext': prompttext})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def aiplacement_editor_generate_image_args(
        self,
        aspectratio: Annotated[Optional[StrictStr], Field(description="The aspect ratio of the image")],
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        prompttext: Annotated[Optional[StrictStr], Field(description="The prompt text for the AI service")],
        quality: Annotated[Optional[StrictStr], Field(description="The quality of the image")],
        numimages: Annotated[Optional[StrictInt], Field(description="The number of images to generate")] = None,
        style: Annotated[Optional[StrictStr], Field(description="The style of the image")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Generate image for the HTML Text editor AI Placement

        Generate image for the HTML Text editor AI Placement

        :param aspectratio: The aspect ratio of the image (required)
        :type aspectratio: str
        :param contextid: The context ID (required)
        :type contextid: int
        :param prompttext: The prompt text for the AI service (required)
        :type prompttext: str
        :param quality: The quality of the image (required)
        :type quality: str
        :param numimages: The number of images to generate
        :type numimages: int
        :param style: The style of the image
        :type style: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._aiplacement_editor_generate_image_serialize(
            aspectratio=aspectratio,
            contextid=contextid,
            prompttext=prompttext,
            quality=quality,
            numimages=numimages,
            style=style,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementEditorGenerateImageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def aiplacement_editor_generate_image(
        self,
        aspectratio: Annotated[Optional[StrictStr], Field(description="The aspect ratio of the image")],
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        prompttext: Annotated[Optional[StrictStr], Field(description="The prompt text for the AI service")],
        quality: Annotated[Optional[StrictStr], Field(description="The quality of the image")],
        numimages: Annotated[Optional[StrictInt], Field(description="The number of images to generate")] = None,
        style: Annotated[Optional[StrictStr], Field(description="The style of the image")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> AiplacementEditorGenerateImageResponse:
        """Generate image for the HTML Text editor AI Placement

        Generate image for the HTML Text editor AI Placement

        :param aspectratio: The aspect ratio of the image (required)
        :type aspectratio: str
        :param contextid: The context ID (required)
        :type contextid: int
        :param prompttext: The prompt text for the AI service (required)
        :type prompttext: str
        :param quality: The quality of the image (required)
        :type quality: str
        :param numimages: The number of images to generate
        :type numimages: int
        :param style: The style of the image
        :type style: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._aiplacement_editor_generate_image_serialize(
            aspectratio=aspectratio,
            contextid=contextid,
            prompttext=prompttext,
            quality=quality,
            numimages=numimages,
            style=style,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementEditorGenerateImageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def aiplacement_editor_generate_image_from_args(
        self,
        args
    ) -> AiplacementEditorGenerateImageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementEditorGenerateImageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def aiplacement_editor_generate_image_with_http_info(
        self,
        aspectratio: Annotated[Optional[StrictStr], Field(description="The aspect ratio of the image")],
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        prompttext: Annotated[Optional[StrictStr], Field(description="The prompt text for the AI service")],
        quality: Annotated[Optional[StrictStr], Field(description="The quality of the image")],
        numimages: Annotated[Optional[StrictInt], Field(description="The number of images to generate")] = None,
        style: Annotated[Optional[StrictStr], Field(description="The style of the image")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[AiplacementEditorGenerateImageResponse]:
        """Generate image for the HTML Text editor AI Placement

        Generate image for the HTML Text editor AI Placement

        :param aspectratio: The aspect ratio of the image (required)
        :type aspectratio: str
        :param contextid: The context ID (required)
        :type contextid: int
        :param prompttext: The prompt text for the AI service (required)
        :type prompttext: str
        :param quality: The quality of the image (required)
        :type quality: str
        :param numimages: The number of images to generate
        :type numimages: int
        :param style: The style of the image
        :type style: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._aiplacement_editor_generate_image_serialize(
            aspectratio=aspectratio,
            contextid=contextid,
            prompttext=prompttext,
            quality=quality,
            numimages=numimages,
            style=style,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementEditorGenerateImageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def aiplacement_editor_generate_image_without_preload_content(
        self,
        aspectratio: Annotated[Optional[StrictStr], Field(description="The aspect ratio of the image")],
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        prompttext: Annotated[Optional[StrictStr], Field(description="The prompt text for the AI service")],
        quality: Annotated[Optional[StrictStr], Field(description="The quality of the image")],
        numimages: Annotated[Optional[StrictInt], Field(description="The number of images to generate")] = None,
        style: Annotated[Optional[StrictStr], Field(description="The style of the image")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Generate image for the HTML Text editor AI Placement

        Generate image for the HTML Text editor AI Placement

        :param aspectratio: The aspect ratio of the image (required)
        :type aspectratio: str
        :param contextid: The context ID (required)
        :type contextid: int
        :param prompttext: The prompt text for the AI service (required)
        :type prompttext: str
        :param quality: The quality of the image (required)
        :type quality: str
        :param numimages: The number of images to generate
        :type numimages: int
        :param style: The style of the image
        :type style: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._aiplacement_editor_generate_image_serialize(
            aspectratio=aspectratio,
            contextid=contextid,
            prompttext=prompttext,
            quality=quality,
            numimages=numimages,
            style=style,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementEditorGenerateImageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _aiplacement_editor_generate_image_serialize(
        self,
        aspectratio,
        contextid,
        prompttext,
        quality,
        numimages,
        style,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#aiplacement_editor_generate_image'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'aiplacement_editor_generate_image'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'aiplacement_editor_generate_image',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if aspectratio is not None:
            _form_params += parse_form({'aspectratio': aspectratio})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if numimages is not None:
            _form_params += parse_form({'numimages': numimages})
        if prompttext is not None:
            _form_params += parse_form({'prompttext': prompttext})
        if quality is not None:
            _form_params += parse_form({'quality': quality})
        if style is not None:
            _form_params += parse_form({'style': style})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def aiplacement_editor_generate_text_args(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        prompttext: Annotated[Optional[StrictStr], Field(description="The prompt text for the AI service")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Generate text for the HTML Text editor AI Placement

        Generate text for the HTML Text editor AI Placement

        :param contextid: The context ID (required)
        :type contextid: int
        :param prompttext: The prompt text for the AI service (required)
        :type prompttext: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._aiplacement_editor_generate_text_serialize(
            contextid=contextid,
            prompttext=prompttext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementEditorGenerateTextResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def aiplacement_editor_generate_text(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        prompttext: Annotated[Optional[StrictStr], Field(description="The prompt text for the AI service")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> AiplacementEditorGenerateTextResponse:
        """Generate text for the HTML Text editor AI Placement

        Generate text for the HTML Text editor AI Placement

        :param contextid: The context ID (required)
        :type contextid: int
        :param prompttext: The prompt text for the AI service (required)
        :type prompttext: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._aiplacement_editor_generate_text_serialize(
            contextid=contextid,
            prompttext=prompttext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementEditorGenerateTextResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def aiplacement_editor_generate_text_from_args(
        self,
        args
    ) -> AiplacementEditorGenerateTextResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementEditorGenerateTextResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def aiplacement_editor_generate_text_with_http_info(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        prompttext: Annotated[Optional[StrictStr], Field(description="The prompt text for the AI service")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[AiplacementEditorGenerateTextResponse]:
        """Generate text for the HTML Text editor AI Placement

        Generate text for the HTML Text editor AI Placement

        :param contextid: The context ID (required)
        :type contextid: int
        :param prompttext: The prompt text for the AI service (required)
        :type prompttext: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._aiplacement_editor_generate_text_serialize(
            contextid=contextid,
            prompttext=prompttext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementEditorGenerateTextResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def aiplacement_editor_generate_text_without_preload_content(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        prompttext: Annotated[Optional[StrictStr], Field(description="The prompt text for the AI service")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Generate text for the HTML Text editor AI Placement

        Generate text for the HTML Text editor AI Placement

        :param contextid: The context ID (required)
        :type contextid: int
        :param prompttext: The prompt text for the AI service (required)
        :type prompttext: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._aiplacement_editor_generate_text_serialize(
            contextid=contextid,
            prompttext=prompttext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AiplacementEditorGenerateTextResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _aiplacement_editor_generate_text_serialize(
        self,
        contextid,
        prompttext,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#aiplacement_editor_generate_text'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'aiplacement_editor_generate_text'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'aiplacement_editor_generate_text',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if prompttext is not None:
            _form_params += parse_form({'prompttext': prompttext})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def auth_email_get_signup_settings_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the signup required settings and profile fields.

        Get the signup required settings and profile fields.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._auth_email_get_signup_settings_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AuthEmailGetSignupSettingsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def auth_email_get_signup_settings(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> AuthEmailGetSignupSettingsResponse:
        """Get the signup required settings and profile fields.

        Get the signup required settings and profile fields.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._auth_email_get_signup_settings_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AuthEmailGetSignupSettingsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def auth_email_get_signup_settings_from_args(
        self,
        args
    ) -> AuthEmailGetSignupSettingsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AuthEmailGetSignupSettingsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def auth_email_get_signup_settings_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[AuthEmailGetSignupSettingsResponse]:
        """Get the signup required settings and profile fields.

        Get the signup required settings and profile fields.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._auth_email_get_signup_settings_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AuthEmailGetSignupSettingsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def auth_email_get_signup_settings_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the signup required settings and profile fields.

        Get the signup required settings and profile fields.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._auth_email_get_signup_settings_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AuthEmailGetSignupSettingsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _auth_email_get_signup_settings_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#auth_email_get_signup_settings'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'auth_email_get_signup_settings'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'auth_email_get_signup_settings',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def auth_email_signup_user_args(
        self,
        args: AuthEmailSignupUserParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Adds a new user (pendingto be confirmed) in the site.

        Adds a new user (pendingto be confirmed) in the site.

        :param args: (required)
        :type args: AuthEmailSignupUserParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._auth_email_signup_user_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AuthEmailSignupUserResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def auth_email_signup_user(
        self,
        args: AuthEmailSignupUserParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> AuthEmailSignupUserResponse:
        """Adds a new user (pendingto be confirmed) in the site.

        Adds a new user (pendingto be confirmed) in the site.

        :param args: (required)
        :type args: AuthEmailSignupUserParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._auth_email_signup_user_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AuthEmailSignupUserResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def auth_email_signup_user_from_args(
        self,
        args
    ) -> AuthEmailSignupUserResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AuthEmailSignupUserResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def auth_email_signup_user_with_http_info(
        self,
        args: AuthEmailSignupUserParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[AuthEmailSignupUserResponse]:
        """Adds a new user (pendingto be confirmed) in the site.

        Adds a new user (pendingto be confirmed) in the site.

        :param args: (required)
        :type args: AuthEmailSignupUserParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._auth_email_signup_user_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AuthEmailSignupUserResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def auth_email_signup_user_without_preload_content(
        self,
        args: AuthEmailSignupUserParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Adds a new user (pendingto be confirmed) in the site.

        Adds a new user (pendingto be confirmed) in the site.

        :param args: (required)
        :type args: AuthEmailSignupUserParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._auth_email_signup_user_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AuthEmailSignupUserResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _auth_email_signup_user_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#auth_email_signup_user'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'auth_email_signup_user'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'auth_email_signup_user',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def block_accessreview_get_module_data_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id to obtain results for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Gets error data for course modules.

        Gets error data for course modules.

        :param courseid: The course id to obtain results for. (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._block_accessreview_get_module_data_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockAccessreviewGetModuleDataResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def block_accessreview_get_module_data(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id to obtain results for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[BlockAccessreviewGetModuleDataResponseInner]:
        """Gets error data for course modules.

        Gets error data for course modules.

        :param courseid: The course id to obtain results for. (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._block_accessreview_get_module_data_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockAccessreviewGetModuleDataResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def block_accessreview_get_module_data_from_args(
        self,
        args
    ) -> List[BlockAccessreviewGetModuleDataResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockAccessreviewGetModuleDataResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def block_accessreview_get_module_data_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id to obtain results for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[BlockAccessreviewGetModuleDataResponseInner]]:
        """Gets error data for course modules.

        Gets error data for course modules.

        :param courseid: The course id to obtain results for. (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._block_accessreview_get_module_data_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockAccessreviewGetModuleDataResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def block_accessreview_get_module_data_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id to obtain results for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Gets error data for course modules.

        Gets error data for course modules.

        :param courseid: The course id to obtain results for. (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._block_accessreview_get_module_data_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockAccessreviewGetModuleDataResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _block_accessreview_get_module_data_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#block_accessreview_get_module_data'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'block_accessreview_get_module_data'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'block_accessreview_get_module_data',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def block_accessreview_get_section_data_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id to obtain results for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Gets error data for course sections.

        Gets error data for course sections.

        :param courseid: The course id to obtain results for. (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._block_accessreview_get_section_data_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockAccessreviewGetSectionDataResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def block_accessreview_get_section_data(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id to obtain results for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[BlockAccessreviewGetSectionDataResponseInner]:
        """Gets error data for course sections.

        Gets error data for course sections.

        :param courseid: The course id to obtain results for. (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._block_accessreview_get_section_data_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockAccessreviewGetSectionDataResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def block_accessreview_get_section_data_from_args(
        self,
        args
    ) -> List[BlockAccessreviewGetSectionDataResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockAccessreviewGetSectionDataResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def block_accessreview_get_section_data_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id to obtain results for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[BlockAccessreviewGetSectionDataResponseInner]]:
        """Gets error data for course sections.

        Gets error data for course sections.

        :param courseid: The course id to obtain results for. (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._block_accessreview_get_section_data_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockAccessreviewGetSectionDataResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def block_accessreview_get_section_data_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id to obtain results for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Gets error data for course sections.

        Gets error data for course sections.

        :param courseid: The course id to obtain results for. (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._block_accessreview_get_section_data_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockAccessreviewGetSectionDataResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _block_accessreview_get_section_data_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#block_accessreview_get_section_data'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'block_accessreview_get_section_data'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'block_accessreview_get_section_data',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def block_recentlyaccesseditems_get_recent_items_args(
        self,
        limit: Annotated[Optional[StrictInt], Field(description="result set limit")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """List of items a user has accessed most recently.

        List of items a user has accessed most recently.

        :param limit: result set limit
        :type limit: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._block_recentlyaccesseditems_get_recent_items_serialize(
            limit=limit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockRecentlyaccesseditemsGetRecentItemsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def block_recentlyaccesseditems_get_recent_items(
        self,
        limit: Annotated[Optional[StrictInt], Field(description="result set limit")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[BlockRecentlyaccesseditemsGetRecentItemsResponseInner]:
        """List of items a user has accessed most recently.

        List of items a user has accessed most recently.

        :param limit: result set limit
        :type limit: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._block_recentlyaccesseditems_get_recent_items_serialize(
            limit=limit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockRecentlyaccesseditemsGetRecentItemsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def block_recentlyaccesseditems_get_recent_items_from_args(
        self,
        args
    ) -> List[BlockRecentlyaccesseditemsGetRecentItemsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockRecentlyaccesseditemsGetRecentItemsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def block_recentlyaccesseditems_get_recent_items_with_http_info(
        self,
        limit: Annotated[Optional[StrictInt], Field(description="result set limit")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[BlockRecentlyaccesseditemsGetRecentItemsResponseInner]]:
        """List of items a user has accessed most recently.

        List of items a user has accessed most recently.

        :param limit: result set limit
        :type limit: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._block_recentlyaccesseditems_get_recent_items_serialize(
            limit=limit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockRecentlyaccesseditemsGetRecentItemsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def block_recentlyaccesseditems_get_recent_items_without_preload_content(
        self,
        limit: Annotated[Optional[StrictInt], Field(description="result set limit")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List of items a user has accessed most recently.

        List of items a user has accessed most recently.

        :param limit: result set limit
        :type limit: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._block_recentlyaccesseditems_get_recent_items_serialize(
            limit=limit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockRecentlyaccesseditemsGetRecentItemsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _block_recentlyaccesseditems_get_recent_items_serialize(
        self,
        limit,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#block_recentlyaccesseditems_get_recent_items'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'block_recentlyaccesseditems_get_recent_items'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'block_recentlyaccesseditems_get_recent_items',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def block_starredcourses_get_starred_courses_args(
        self,
        limit: Annotated[Optional[StrictInt], Field(description="Limit")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Offset")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get users starred courses.

        Get users starred courses.

        :param limit: Limit
        :type limit: int
        :param offset: Offset
        :type offset: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._block_starredcourses_get_starred_courses_serialize(
            limit=limit,
            offset=offset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockStarredcoursesGetStarredCoursesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def block_starredcourses_get_starred_courses(
        self,
        limit: Annotated[Optional[StrictInt], Field(description="Limit")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Offset")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[BlockStarredcoursesGetStarredCoursesResponseInner]:
        """Get users starred courses.

        Get users starred courses.

        :param limit: Limit
        :type limit: int
        :param offset: Offset
        :type offset: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._block_starredcourses_get_starred_courses_serialize(
            limit=limit,
            offset=offset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockStarredcoursesGetStarredCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def block_starredcourses_get_starred_courses_from_args(
        self,
        args
    ) -> List[BlockStarredcoursesGetStarredCoursesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockStarredcoursesGetStarredCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def block_starredcourses_get_starred_courses_with_http_info(
        self,
        limit: Annotated[Optional[StrictInt], Field(description="Limit")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Offset")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[BlockStarredcoursesGetStarredCoursesResponseInner]]:
        """Get users starred courses.

        Get users starred courses.

        :param limit: Limit
        :type limit: int
        :param offset: Offset
        :type offset: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._block_starredcourses_get_starred_courses_serialize(
            limit=limit,
            offset=offset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockStarredcoursesGetStarredCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def block_starredcourses_get_starred_courses_without_preload_content(
        self,
        limit: Annotated[Optional[StrictInt], Field(description="Limit")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Offset")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get users starred courses.

        Get users starred courses.

        :param limit: Limit
        :type limit: int
        :param offset: Offset
        :type offset: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._block_starredcourses_get_starred_courses_serialize(
            limit=limit,
            offset=offset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockStarredcoursesGetStarredCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _block_starredcourses_get_starred_courses_serialize(
        self,
        limit,
        offset,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#block_starredcourses_get_starred_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'block_starredcourses_get_starred_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'block_starredcourses_get_starred_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if offset is not None:
            _form_params += parse_form({'offset': offset})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_admin_set_block_protection_args(
        self,
        plugin: Annotated[Optional[StrictStr], Field(description="The name of the plugin")],
        state: Annotated[Optional[StrictInt], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set the protection state for a block plugin

        Set the protection state for a block plugin

        :param plugin: The name of the plugin (required)
        :type plugin: str
        :param state: The target state (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_admin_set_block_protection_serialize(
            plugin=plugin,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_admin_set_block_protection(
        self,
        plugin: Annotated[Optional[StrictStr], Field(description="The name of the plugin")],
        state: Annotated[Optional[StrictInt], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Set the protection state for a block plugin

        Set the protection state for a block plugin

        :param plugin: The name of the plugin (required)
        :type plugin: str
        :param state: The target state (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_admin_set_block_protection_serialize(
            plugin=plugin,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_admin_set_block_protection_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_admin_set_block_protection_with_http_info(
        self,
        plugin: Annotated[Optional[StrictStr], Field(description="The name of the plugin")],
        state: Annotated[Optional[StrictInt], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Set the protection state for a block plugin

        Set the protection state for a block plugin

        :param plugin: The name of the plugin (required)
        :type plugin: str
        :param state: The target state (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_admin_set_block_protection_serialize(
            plugin=plugin,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_admin_set_block_protection_without_preload_content(
        self,
        plugin: Annotated[Optional[StrictStr], Field(description="The name of the plugin")],
        state: Annotated[Optional[StrictInt], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set the protection state for a block plugin

        Set the protection state for a block plugin

        :param plugin: The name of the plugin (required)
        :type plugin: str
        :param state: The target state (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_admin_set_block_protection_serialize(
            plugin=plugin,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_admin_set_block_protection_serialize(
        self,
        plugin,
        state,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_admin_set_block_protection'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_admin_set_block_protection'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_admin_set_block_protection',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if plugin is not None:
            _form_params += parse_form({'plugin': plugin})
        if state is not None:
            _form_params += parse_form({'state': state})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_admin_set_plugin_order_args(
        self,
        direction: Annotated[Optional[StrictInt], Field(description="The direction to move")],
        plugin: Annotated[Optional[StrictStr], Field(description="The name of the plugin")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set the order of a plugin

        Set the order of a plugin

        :param direction: The direction to move (required)
        :type direction: int
        :param plugin: The name of the plugin (required)
        :type plugin: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_admin_set_plugin_order_serialize(
            direction=direction,
            plugin=plugin,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_admin_set_plugin_order(
        self,
        direction: Annotated[Optional[StrictInt], Field(description="The direction to move")],
        plugin: Annotated[Optional[StrictStr], Field(description="The name of the plugin")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Set the order of a plugin

        Set the order of a plugin

        :param direction: The direction to move (required)
        :type direction: int
        :param plugin: The name of the plugin (required)
        :type plugin: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_admin_set_plugin_order_serialize(
            direction=direction,
            plugin=plugin,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_admin_set_plugin_order_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_admin_set_plugin_order_with_http_info(
        self,
        direction: Annotated[Optional[StrictInt], Field(description="The direction to move")],
        plugin: Annotated[Optional[StrictStr], Field(description="The name of the plugin")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Set the order of a plugin

        Set the order of a plugin

        :param direction: The direction to move (required)
        :type direction: int
        :param plugin: The name of the plugin (required)
        :type plugin: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_admin_set_plugin_order_serialize(
            direction=direction,
            plugin=plugin,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_admin_set_plugin_order_without_preload_content(
        self,
        direction: Annotated[Optional[StrictInt], Field(description="The direction to move")],
        plugin: Annotated[Optional[StrictStr], Field(description="The name of the plugin")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set the order of a plugin

        Set the order of a plugin

        :param direction: The direction to move (required)
        :type direction: int
        :param plugin: The name of the plugin (required)
        :type plugin: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_admin_set_plugin_order_serialize(
            direction=direction,
            plugin=plugin,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_admin_set_plugin_order_serialize(
        self,
        direction,
        plugin,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_admin_set_plugin_order'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_admin_set_plugin_order'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_admin_set_plugin_order',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if direction is not None:
            _form_params += parse_form({'direction': direction})
        if plugin is not None:
            _form_params += parse_form({'plugin': plugin})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_admin_set_plugin_state_args(
        self,
        plugin: Annotated[Optional[StrictStr], Field(description="The name of the plugin")],
        state: Annotated[Optional[StrictInt], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set the state of a plugin

        Set the state of a plugin

        :param plugin: The name of the plugin (required)
        :type plugin: str
        :param state: The target state (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_admin_set_plugin_state_serialize(
            plugin=plugin,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_admin_set_plugin_state(
        self,
        plugin: Annotated[Optional[StrictStr], Field(description="The name of the plugin")],
        state: Annotated[Optional[StrictInt], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Set the state of a plugin

        Set the state of a plugin

        :param plugin: The name of the plugin (required)
        :type plugin: str
        :param state: The target state (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_admin_set_plugin_state_serialize(
            plugin=plugin,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_admin_set_plugin_state_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_admin_set_plugin_state_with_http_info(
        self,
        plugin: Annotated[Optional[StrictStr], Field(description="The name of the plugin")],
        state: Annotated[Optional[StrictInt], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Set the state of a plugin

        Set the state of a plugin

        :param plugin: The name of the plugin (required)
        :type plugin: str
        :param state: The target state (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_admin_set_plugin_state_serialize(
            plugin=plugin,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_admin_set_plugin_state_without_preload_content(
        self,
        plugin: Annotated[Optional[StrictStr], Field(description="The name of the plugin")],
        state: Annotated[Optional[StrictInt], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set the state of a plugin

        Set the state of a plugin

        :param plugin: The name of the plugin (required)
        :type plugin: str
        :param state: The target state (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_admin_set_plugin_state_serialize(
            plugin=plugin,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_admin_set_plugin_state_serialize(
        self,
        plugin,
        state,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_admin_set_plugin_state'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_admin_set_plugin_state'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_admin_set_plugin_state',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if plugin is not None:
            _form_params += parse_form({'plugin': plugin})
        if state is not None:
            _form_params += parse_form({'state': state})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_ai_delete_provider_instance_args(
        self,
        providerid: Annotated[Optional[StrictInt], Field(description="Provider ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete a provider instance

        Delete a provider instance

        :param providerid: Provider ID (required)
        :type providerid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_delete_provider_instance_serialize(
            providerid=providerid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiDeleteProviderInstanceResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_ai_delete_provider_instance(
        self,
        providerid: Annotated[Optional[StrictInt], Field(description="Provider ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreAiDeleteProviderInstanceResponse:
        """Delete a provider instance

        Delete a provider instance

        :param providerid: Provider ID (required)
        :type providerid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_delete_provider_instance_serialize(
            providerid=providerid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiDeleteProviderInstanceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_ai_delete_provider_instance_from_args(
        self,
        args
    ) -> CoreAiDeleteProviderInstanceResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiDeleteProviderInstanceResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_ai_delete_provider_instance_with_http_info(
        self,
        providerid: Annotated[Optional[StrictInt], Field(description="Provider ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreAiDeleteProviderInstanceResponse]:
        """Delete a provider instance

        Delete a provider instance

        :param providerid: Provider ID (required)
        :type providerid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_delete_provider_instance_serialize(
            providerid=providerid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiDeleteProviderInstanceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_ai_delete_provider_instance_without_preload_content(
        self,
        providerid: Annotated[Optional[StrictInt], Field(description="Provider ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete a provider instance

        Delete a provider instance

        :param providerid: Provider ID (required)
        :type providerid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_delete_provider_instance_serialize(
            providerid=providerid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiDeleteProviderInstanceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_ai_delete_provider_instance_serialize(
        self,
        providerid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_ai_delete_provider_instance'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_ai_delete_provider_instance'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_ai_delete_provider_instance',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if providerid is not None:
            _form_params += parse_form({'providerid': providerid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_ai_get_policy_status_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get a users AI policy acceptance

        Get a users AI policy acceptance

        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_get_policy_status_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiGetPolicyStatusResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_ai_get_policy_status(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreAiGetPolicyStatusResponse:
        """Get a users AI policy acceptance

        Get a users AI policy acceptance

        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_get_policy_status_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiGetPolicyStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_ai_get_policy_status_from_args(
        self,
        args
    ) -> CoreAiGetPolicyStatusResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiGetPolicyStatusResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_ai_get_policy_status_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreAiGetPolicyStatusResponse]:
        """Get a users AI policy acceptance

        Get a users AI policy acceptance

        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_get_policy_status_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiGetPolicyStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_ai_get_policy_status_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get a users AI policy acceptance

        Get a users AI policy acceptance

        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_get_policy_status_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiGetPolicyStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_ai_get_policy_status_serialize(
        self,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_ai_get_policy_status'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_ai_get_policy_status'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_ai_get_policy_status',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_ai_set_action_args(
        self,
        plugin: Annotated[Optional[StrictStr], Field(description="The name of the plugin and the action to change state for")],
        state: Annotated[Optional[StrictInt], Field(description="The target state")],
        providerid: Annotated[Optional[StrictInt], Field(description="The provider id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update action

        Update action

        :param plugin: The name of the plugin and the action to change state for (required)
        :type plugin: str
        :param state: The target state (required)
        :type state: int
        :param providerid: The provider id
        :type providerid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_set_action_serialize(
            plugin=plugin,
            state=state,
            providerid=providerid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_ai_set_action(
        self,
        plugin: Annotated[Optional[StrictStr], Field(description="The name of the plugin and the action to change state for")],
        state: Annotated[Optional[StrictInt], Field(description="The target state")],
        providerid: Annotated[Optional[StrictInt], Field(description="The provider id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Update action

        Update action

        :param plugin: The name of the plugin and the action to change state for (required)
        :type plugin: str
        :param state: The target state (required)
        :type state: int
        :param providerid: The provider id
        :type providerid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_set_action_serialize(
            plugin=plugin,
            state=state,
            providerid=providerid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_ai_set_action_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_ai_set_action_with_http_info(
        self,
        plugin: Annotated[Optional[StrictStr], Field(description="The name of the plugin and the action to change state for")],
        state: Annotated[Optional[StrictInt], Field(description="The target state")],
        providerid: Annotated[Optional[StrictInt], Field(description="The provider id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Update action

        Update action

        :param plugin: The name of the plugin and the action to change state for (required)
        :type plugin: str
        :param state: The target state (required)
        :type state: int
        :param providerid: The provider id
        :type providerid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_set_action_serialize(
            plugin=plugin,
            state=state,
            providerid=providerid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_ai_set_action_without_preload_content(
        self,
        plugin: Annotated[Optional[StrictStr], Field(description="The name of the plugin and the action to change state for")],
        state: Annotated[Optional[StrictInt], Field(description="The target state")],
        providerid: Annotated[Optional[StrictInt], Field(description="The provider id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update action

        Update action

        :param plugin: The name of the plugin and the action to change state for (required)
        :type plugin: str
        :param state: The target state (required)
        :type state: int
        :param providerid: The provider id
        :type providerid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_set_action_serialize(
            plugin=plugin,
            state=state,
            providerid=providerid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_ai_set_action_serialize(
        self,
        plugin,
        state,
        providerid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_ai_set_action'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_ai_set_action'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_ai_set_action',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if plugin is not None:
            _form_params += parse_form({'plugin': plugin})
        if providerid is not None:
            _form_params += parse_form({'providerid': providerid})
        if state is not None:
            _form_params += parse_form({'state': state})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_ai_set_policy_status_args(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set a users AI policy acceptance

        Set a users AI policy acceptance

        :param contextid: The context ID (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_set_policy_status_serialize(
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiSetPolicyStatusResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_ai_set_policy_status(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreAiSetPolicyStatusResponse:
        """Set a users AI policy acceptance

        Set a users AI policy acceptance

        :param contextid: The context ID (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_set_policy_status_serialize(
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiSetPolicyStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_ai_set_policy_status_from_args(
        self,
        args
    ) -> CoreAiSetPolicyStatusResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiSetPolicyStatusResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_ai_set_policy_status_with_http_info(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreAiSetPolicyStatusResponse]:
        """Set a users AI policy acceptance

        Set a users AI policy acceptance

        :param contextid: The context ID (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_set_policy_status_serialize(
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiSetPolicyStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_ai_set_policy_status_without_preload_content(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set a users AI policy acceptance

        Set a users AI policy acceptance

        :param contextid: The context ID (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_set_policy_status_serialize(
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiSetPolicyStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_ai_set_policy_status_serialize(
        self,
        contextid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_ai_set_policy_status'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_ai_set_policy_status'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_ai_set_policy_status',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_ai_set_provider_order_args(
        self,
        direction: Annotated[Optional[StrictInt], Field(description="The direction to move")],
        plugin: Annotated[Optional[StrictInt], Field(description=" The provider instance ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set the order of a provider

        Set the order of a provider

        :param direction: The direction to move (required)
        :type direction: int
        :param plugin:  The provider instance ID (required)
        :type plugin: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_set_provider_order_serialize(
            direction=direction,
            plugin=plugin,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_ai_set_provider_order(
        self,
        direction: Annotated[Optional[StrictInt], Field(description="The direction to move")],
        plugin: Annotated[Optional[StrictInt], Field(description=" The provider instance ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Set the order of a provider

        Set the order of a provider

        :param direction: The direction to move (required)
        :type direction: int
        :param plugin:  The provider instance ID (required)
        :type plugin: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_set_provider_order_serialize(
            direction=direction,
            plugin=plugin,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_ai_set_provider_order_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_ai_set_provider_order_with_http_info(
        self,
        direction: Annotated[Optional[StrictInt], Field(description="The direction to move")],
        plugin: Annotated[Optional[StrictInt], Field(description=" The provider instance ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Set the order of a provider

        Set the order of a provider

        :param direction: The direction to move (required)
        :type direction: int
        :param plugin:  The provider instance ID (required)
        :type plugin: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_set_provider_order_serialize(
            direction=direction,
            plugin=plugin,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_ai_set_provider_order_without_preload_content(
        self,
        direction: Annotated[Optional[StrictInt], Field(description="The direction to move")],
        plugin: Annotated[Optional[StrictInt], Field(description=" The provider instance ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set the order of a provider

        Set the order of a provider

        :param direction: The direction to move (required)
        :type direction: int
        :param plugin:  The provider instance ID (required)
        :type plugin: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_set_provider_order_serialize(
            direction=direction,
            plugin=plugin,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_ai_set_provider_order_serialize(
        self,
        direction,
        plugin,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_ai_set_provider_order'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_ai_set_provider_order'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_ai_set_provider_order',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if direction is not None:
            _form_params += parse_form({'direction': direction})
        if plugin is not None:
            _form_params += parse_form({'plugin': plugin})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_ai_set_provider_status_args(
        self,
        plugin: Annotated[Optional[StrictInt], Field(description="Provider ID")],
        state: Annotated[Optional[StrictInt], Field(description="Enabled or disabled")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set a providers status

        Set a providers status

        :param plugin: Provider ID (required)
        :type plugin: int
        :param state: Enabled or disabled (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_set_provider_status_serialize(
            plugin=plugin,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiSetProviderStatusResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_ai_set_provider_status(
        self,
        plugin: Annotated[Optional[StrictInt], Field(description="Provider ID")],
        state: Annotated[Optional[StrictInt], Field(description="Enabled or disabled")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreAiSetProviderStatusResponse:
        """Set a providers status

        Set a providers status

        :param plugin: Provider ID (required)
        :type plugin: int
        :param state: Enabled or disabled (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_set_provider_status_serialize(
            plugin=plugin,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiSetProviderStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_ai_set_provider_status_from_args(
        self,
        args
    ) -> CoreAiSetProviderStatusResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiSetProviderStatusResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_ai_set_provider_status_with_http_info(
        self,
        plugin: Annotated[Optional[StrictInt], Field(description="Provider ID")],
        state: Annotated[Optional[StrictInt], Field(description="Enabled or disabled")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreAiSetProviderStatusResponse]:
        """Set a providers status

        Set a providers status

        :param plugin: Provider ID (required)
        :type plugin: int
        :param state: Enabled or disabled (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_set_provider_status_serialize(
            plugin=plugin,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiSetProviderStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_ai_set_provider_status_without_preload_content(
        self,
        plugin: Annotated[Optional[StrictInt], Field(description="Provider ID")],
        state: Annotated[Optional[StrictInt], Field(description="Enabled or disabled")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set a providers status

        Set a providers status

        :param plugin: Provider ID (required)
        :type plugin: int
        :param state: Enabled or disabled (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_ai_set_provider_status_serialize(
            plugin=plugin,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAiSetProviderStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_ai_set_provider_status_serialize(
        self,
        plugin,
        state,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_ai_set_provider_status'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_ai_set_provider_status'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_ai_set_provider_status',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if plugin is not None:
            _form_params += parse_form({'plugin': plugin})
        if state is not None:
            _form_params += parse_form({'state': state})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_auth_confirm_user_args(
        self,
        args: CoreAuthConfirmUserParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Confirm a user account.

        Confirm a user account.

        :param args: (required)
        :type args: CoreAuthConfirmUserParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_confirm_user_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthConfirmUserResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_auth_confirm_user(
        self,
        args: CoreAuthConfirmUserParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreAuthConfirmUserResponse:
        """Confirm a user account.

        Confirm a user account.

        :param args: (required)
        :type args: CoreAuthConfirmUserParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_confirm_user_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthConfirmUserResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_auth_confirm_user_from_args(
        self,
        args
    ) -> CoreAuthConfirmUserResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthConfirmUserResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_auth_confirm_user_with_http_info(
        self,
        args: CoreAuthConfirmUserParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreAuthConfirmUserResponse]:
        """Confirm a user account.

        Confirm a user account.

        :param args: (required)
        :type args: CoreAuthConfirmUserParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_confirm_user_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthConfirmUserResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_auth_confirm_user_without_preload_content(
        self,
        args: CoreAuthConfirmUserParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Confirm a user account.

        Confirm a user account.

        :param args: (required)
        :type args: CoreAuthConfirmUserParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_confirm_user_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthConfirmUserResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_auth_confirm_user_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#core_auth_confirm_user'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_auth_confirm_user'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_auth_confirm_user',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_auth_is_age_digital_consent_verification_enabled_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Checks if age digital consent verification is enabled.

        Checks if age digital consent verification is enabled.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_is_age_digital_consent_verification_enabled_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthIsAgeDigitalConsentVerificationEnabledResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_auth_is_age_digital_consent_verification_enabled(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreAuthIsAgeDigitalConsentVerificationEnabledResponse:
        """Checks if age digital consent verification is enabled.

        Checks if age digital consent verification is enabled.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_is_age_digital_consent_verification_enabled_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthIsAgeDigitalConsentVerificationEnabledResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_auth_is_age_digital_consent_verification_enabled_from_args(
        self,
        args
    ) -> CoreAuthIsAgeDigitalConsentVerificationEnabledResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthIsAgeDigitalConsentVerificationEnabledResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_auth_is_age_digital_consent_verification_enabled_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreAuthIsAgeDigitalConsentVerificationEnabledResponse]:
        """Checks if age digital consent verification is enabled.

        Checks if age digital consent verification is enabled.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_is_age_digital_consent_verification_enabled_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthIsAgeDigitalConsentVerificationEnabledResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_auth_is_age_digital_consent_verification_enabled_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Checks if age digital consent verification is enabled.

        Checks if age digital consent verification is enabled.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_is_age_digital_consent_verification_enabled_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthIsAgeDigitalConsentVerificationEnabledResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_auth_is_age_digital_consent_verification_enabled_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#core_auth_is_age_digital_consent_verification_enabled'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_auth_is_age_digital_consent_verification_enabled'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_auth_is_age_digital_consent_verification_enabled',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_auth_is_minor_args(
        self,
        args: CoreAuthIsMinorParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Requests a check if a user is a digital minor.

        Requests a check if a user is a digital minor.

        :param args: (required)
        :type args: CoreAuthIsMinorParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_is_minor_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthIsMinorResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_auth_is_minor(
        self,
        args: CoreAuthIsMinorParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreAuthIsMinorResponse:
        """Requests a check if a user is a digital minor.

        Requests a check if a user is a digital minor.

        :param args: (required)
        :type args: CoreAuthIsMinorParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_is_minor_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthIsMinorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_auth_is_minor_from_args(
        self,
        args
    ) -> CoreAuthIsMinorResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthIsMinorResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_auth_is_minor_with_http_info(
        self,
        args: CoreAuthIsMinorParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreAuthIsMinorResponse]:
        """Requests a check if a user is a digital minor.

        Requests a check if a user is a digital minor.

        :param args: (required)
        :type args: CoreAuthIsMinorParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_is_minor_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthIsMinorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_auth_is_minor_without_preload_content(
        self,
        args: CoreAuthIsMinorParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Requests a check if a user is a digital minor.

        Requests a check if a user is a digital minor.

        :param args: (required)
        :type args: CoreAuthIsMinorParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_is_minor_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthIsMinorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_auth_is_minor_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#core_auth_is_minor'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_auth_is_minor'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_auth_is_minor',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_auth_request_password_reset_args(
        self,
        args: CoreAuthRequestPasswordResetParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Requests a password reset.

        Requests a password reset.

        :param args: (required)
        :type args: CoreAuthRequestPasswordResetParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_request_password_reset_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthRequestPasswordResetResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_auth_request_password_reset(
        self,
        args: CoreAuthRequestPasswordResetParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreAuthRequestPasswordResetResponse:
        """Requests a password reset.

        Requests a password reset.

        :param args: (required)
        :type args: CoreAuthRequestPasswordResetParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_request_password_reset_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthRequestPasswordResetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_auth_request_password_reset_from_args(
        self,
        args
    ) -> CoreAuthRequestPasswordResetResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthRequestPasswordResetResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_auth_request_password_reset_with_http_info(
        self,
        args: CoreAuthRequestPasswordResetParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreAuthRequestPasswordResetResponse]:
        """Requests a password reset.

        Requests a password reset.

        :param args: (required)
        :type args: CoreAuthRequestPasswordResetParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_request_password_reset_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthRequestPasswordResetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_auth_request_password_reset_without_preload_content(
        self,
        args: CoreAuthRequestPasswordResetParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Requests a password reset.

        Requests a password reset.

        :param args: (required)
        :type args: CoreAuthRequestPasswordResetParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_request_password_reset_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthRequestPasswordResetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_auth_request_password_reset_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#core_auth_request_password_reset'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_auth_request_password_reset'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_auth_request_password_reset',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_auth_resend_confirmation_email_args(
        self,
        args: CoreAuthResendConfirmationEmailParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Resend confirmation email.

        Resend confirmation email.

        :param args: (required)
        :type args: CoreAuthResendConfirmationEmailParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_resend_confirmation_email_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthResendConfirmationEmailResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_auth_resend_confirmation_email(
        self,
        args: CoreAuthResendConfirmationEmailParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreAuthResendConfirmationEmailResponse:
        """Resend confirmation email.

        Resend confirmation email.

        :param args: (required)
        :type args: CoreAuthResendConfirmationEmailParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_resend_confirmation_email_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthResendConfirmationEmailResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_auth_resend_confirmation_email_from_args(
        self,
        args
    ) -> CoreAuthResendConfirmationEmailResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthResendConfirmationEmailResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_auth_resend_confirmation_email_with_http_info(
        self,
        args: CoreAuthResendConfirmationEmailParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreAuthResendConfirmationEmailResponse]:
        """Resend confirmation email.

        Resend confirmation email.

        :param args: (required)
        :type args: CoreAuthResendConfirmationEmailParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_resend_confirmation_email_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthResendConfirmationEmailResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_auth_resend_confirmation_email_without_preload_content(
        self,
        args: CoreAuthResendConfirmationEmailParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Resend confirmation email.

        Resend confirmation email.

        :param args: (required)
        :type args: CoreAuthResendConfirmationEmailParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_auth_resend_confirmation_email_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreAuthResendConfirmationEmailResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_auth_resend_confirmation_email_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#core_auth_resend_confirmation_email'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_auth_resend_confirmation_email'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_auth_resend_confirmation_email',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_backup_get_async_backup_links_backup_args(
        self,
        backupid: Annotated[StrictStr, Field(description="Backup id")],
        contextid: Annotated[StrictInt, Field(description="Context id")],
        filename: Annotated[StrictStr, Field(description="Backup filename")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Gets the data to use when updating the status table row in the UI for when an async backup completes.

        Gets the data to use when updating the status table row in the UI for when an async backup completes.

        :param backupid: Backup id (required)
        :type backupid: str
        :param contextid: Context id (required)
        :type contextid: int
        :param filename: Backup filename (required)
        :type filename: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_get_async_backup_links_backup_serialize(
            backupid=backupid,
            contextid=contextid,
            filename=filename,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBackupGetAsyncBackupLinksBackupResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_backup_get_async_backup_links_backup(
        self,
        backupid: Annotated[StrictStr, Field(description="Backup id")],
        contextid: Annotated[StrictInt, Field(description="Context id")],
        filename: Annotated[StrictStr, Field(description="Backup filename")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreBackupGetAsyncBackupLinksBackupResponse:
        """Gets the data to use when updating the status table row in the UI for when an async backup completes.

        Gets the data to use when updating the status table row in the UI for when an async backup completes.

        :param backupid: Backup id (required)
        :type backupid: str
        :param contextid: Context id (required)
        :type contextid: int
        :param filename: Backup filename (required)
        :type filename: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_get_async_backup_links_backup_serialize(
            backupid=backupid,
            contextid=contextid,
            filename=filename,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBackupGetAsyncBackupLinksBackupResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_backup_get_async_backup_links_backup_from_args(
        self,
        args
    ) -> CoreBackupGetAsyncBackupLinksBackupResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBackupGetAsyncBackupLinksBackupResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_backup_get_async_backup_links_backup_with_http_info(
        self,
        backupid: Annotated[StrictStr, Field(description="Backup id")],
        contextid: Annotated[StrictInt, Field(description="Context id")],
        filename: Annotated[StrictStr, Field(description="Backup filename")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreBackupGetAsyncBackupLinksBackupResponse]:
        """Gets the data to use when updating the status table row in the UI for when an async backup completes.

        Gets the data to use when updating the status table row in the UI for when an async backup completes.

        :param backupid: Backup id (required)
        :type backupid: str
        :param contextid: Context id (required)
        :type contextid: int
        :param filename: Backup filename (required)
        :type filename: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_get_async_backup_links_backup_serialize(
            backupid=backupid,
            contextid=contextid,
            filename=filename,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBackupGetAsyncBackupLinksBackupResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_backup_get_async_backup_links_backup_without_preload_content(
        self,
        backupid: Annotated[StrictStr, Field(description="Backup id")],
        contextid: Annotated[StrictInt, Field(description="Context id")],
        filename: Annotated[StrictStr, Field(description="Backup filename")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Gets the data to use when updating the status table row in the UI for when an async backup completes.

        Gets the data to use when updating the status table row in the UI for when an async backup completes.

        :param backupid: Backup id (required)
        :type backupid: str
        :param contextid: Context id (required)
        :type contextid: int
        :param filename: Backup filename (required)
        :type filename: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_get_async_backup_links_backup_serialize(
            backupid=backupid,
            contextid=contextid,
            filename=filename,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBackupGetAsyncBackupLinksBackupResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_backup_get_async_backup_links_backup_serialize(
        self,
        backupid,
        contextid,
        filename,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_backup_get_async_backup_links_backup'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_backup_get_async_backup_links_backup'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_backup_get_async_backup_links_backup',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if backupid is not None:
            _form_params += parse_form({'backupid': backupid})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if filename is not None:
            _form_params += parse_form({'filename': filename})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_backup_get_async_backup_links_restore_args(
        self,
        backupid: Annotated[StrictStr, Field(description="Backup id")],
        contextid: Annotated[StrictInt, Field(description="Context id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Gets the data to use when updating the status table row in the UI for when an async restore completes.

        Gets the data to use when updating the status table row in the UI for when an async restore completes.

        :param backupid: Backup id (required)
        :type backupid: str
        :param contextid: Context id (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_get_async_backup_links_restore_serialize(
            backupid=backupid,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBackupGetAsyncBackupLinksRestoreResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_backup_get_async_backup_links_restore(
        self,
        backupid: Annotated[StrictStr, Field(description="Backup id")],
        contextid: Annotated[StrictInt, Field(description="Context id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreBackupGetAsyncBackupLinksRestoreResponse:
        """Gets the data to use when updating the status table row in the UI for when an async restore completes.

        Gets the data to use when updating the status table row in the UI for when an async restore completes.

        :param backupid: Backup id (required)
        :type backupid: str
        :param contextid: Context id (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_get_async_backup_links_restore_serialize(
            backupid=backupid,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBackupGetAsyncBackupLinksRestoreResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_backup_get_async_backup_links_restore_from_args(
        self,
        args
    ) -> CoreBackupGetAsyncBackupLinksRestoreResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBackupGetAsyncBackupLinksRestoreResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_backup_get_async_backup_links_restore_with_http_info(
        self,
        backupid: Annotated[StrictStr, Field(description="Backup id")],
        contextid: Annotated[StrictInt, Field(description="Context id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreBackupGetAsyncBackupLinksRestoreResponse]:
        """Gets the data to use when updating the status table row in the UI for when an async restore completes.

        Gets the data to use when updating the status table row in the UI for when an async restore completes.

        :param backupid: Backup id (required)
        :type backupid: str
        :param contextid: Context id (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_get_async_backup_links_restore_serialize(
            backupid=backupid,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBackupGetAsyncBackupLinksRestoreResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_backup_get_async_backup_links_restore_without_preload_content(
        self,
        backupid: Annotated[StrictStr, Field(description="Backup id")],
        contextid: Annotated[StrictInt, Field(description="Context id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Gets the data to use when updating the status table row in the UI for when an async restore completes.

        Gets the data to use when updating the status table row in the UI for when an async restore completes.

        :param backupid: Backup id (required)
        :type backupid: str
        :param contextid: Context id (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_get_async_backup_links_restore_serialize(
            backupid=backupid,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBackupGetAsyncBackupLinksRestoreResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_backup_get_async_backup_links_restore_serialize(
        self,
        backupid,
        contextid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_backup_get_async_backup_links_restore'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_backup_get_async_backup_links_restore'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_backup_get_async_backup_links_restore',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if backupid is not None:
            _form_params += parse_form({'backupid': backupid})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_backup_get_async_backup_progress_args(
        self,
        backupids: Annotated[List[Optional[StrictStr]], Field(description="Backup id to get progress for")],
        contextid: Annotated[StrictInt, Field(description="Context id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the progress of an Asyncronhous backup.

        Get the progress of an Asyncronhous backup.

        :param backupids: Backup id to get progress for (required)
        :type backupids: List[Optional[str]]
        :param contextid: Context id (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_get_async_backup_progress_serialize(
            backupids=backupids,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreBackupGetAsyncBackupProgressResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_backup_get_async_backup_progress(
        self,
        backupids: Annotated[List[Optional[StrictStr]], Field(description="Backup id to get progress for")],
        contextid: Annotated[StrictInt, Field(description="Context id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreBackupGetAsyncBackupProgressResponseInner]:
        """Get the progress of an Asyncronhous backup.

        Get the progress of an Asyncronhous backup.

        :param backupids: Backup id to get progress for (required)
        :type backupids: List[Optional[str]]
        :param contextid: Context id (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_get_async_backup_progress_serialize(
            backupids=backupids,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreBackupGetAsyncBackupProgressResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_backup_get_async_backup_progress_from_args(
        self,
        args
    ) -> List[CoreBackupGetAsyncBackupProgressResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreBackupGetAsyncBackupProgressResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_backup_get_async_backup_progress_with_http_info(
        self,
        backupids: Annotated[List[Optional[StrictStr]], Field(description="Backup id to get progress for")],
        contextid: Annotated[StrictInt, Field(description="Context id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreBackupGetAsyncBackupProgressResponseInner]]:
        """Get the progress of an Asyncronhous backup.

        Get the progress of an Asyncronhous backup.

        :param backupids: Backup id to get progress for (required)
        :type backupids: List[Optional[str]]
        :param contextid: Context id (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_get_async_backup_progress_serialize(
            backupids=backupids,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreBackupGetAsyncBackupProgressResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_backup_get_async_backup_progress_without_preload_content(
        self,
        backupids: Annotated[List[Optional[StrictStr]], Field(description="Backup id to get progress for")],
        contextid: Annotated[StrictInt, Field(description="Context id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the progress of an Asyncronhous backup.

        Get the progress of an Asyncronhous backup.

        :param backupids: Backup id to get progress for (required)
        :type backupids: List[Optional[str]]
        :param contextid: Context id (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_get_async_backup_progress_serialize(
            backupids=backupids,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreBackupGetAsyncBackupProgressResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_backup_get_async_backup_progress_serialize(
        self,
        backupids,
        contextid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'backupids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_backup_get_async_backup_progress'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_backup_get_async_backup_progress'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_backup_get_async_backup_progress',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if backupids is not None:
            _form_params += parse_form({'backupids': backupids})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_backup_get_copy_progress_args(
        self,
        copies: Annotated[List[CoreBackupGetCopyProgressParametersCopiesInner], Field(description="Copy data")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Gets the progress of course copy operations.

        Gets the progress of course copy operations.

        :param copies: Copy data (required)
        :type copies: List[CoreBackupGetCopyProgressParametersCopiesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_get_copy_progress_serialize(
            copies=copies,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreBackupGetCopyProgressResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_backup_get_copy_progress(
        self,
        copies: Annotated[List[CoreBackupGetCopyProgressParametersCopiesInner], Field(description="Copy data")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreBackupGetCopyProgressResponseInner]:
        """Gets the progress of course copy operations.

        Gets the progress of course copy operations.

        :param copies: Copy data (required)
        :type copies: List[CoreBackupGetCopyProgressParametersCopiesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_get_copy_progress_serialize(
            copies=copies,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreBackupGetCopyProgressResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_backup_get_copy_progress_from_args(
        self,
        args
    ) -> List[CoreBackupGetCopyProgressResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreBackupGetCopyProgressResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_backup_get_copy_progress_with_http_info(
        self,
        copies: Annotated[List[CoreBackupGetCopyProgressParametersCopiesInner], Field(description="Copy data")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreBackupGetCopyProgressResponseInner]]:
        """Gets the progress of course copy operations.

        Gets the progress of course copy operations.

        :param copies: Copy data (required)
        :type copies: List[CoreBackupGetCopyProgressParametersCopiesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_get_copy_progress_serialize(
            copies=copies,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreBackupGetCopyProgressResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_backup_get_copy_progress_without_preload_content(
        self,
        copies: Annotated[List[CoreBackupGetCopyProgressParametersCopiesInner], Field(description="Copy data")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Gets the progress of course copy operations.

        Gets the progress of course copy operations.

        :param copies: Copy data (required)
        :type copies: List[CoreBackupGetCopyProgressParametersCopiesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_get_copy_progress_serialize(
            copies=copies,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreBackupGetCopyProgressResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_backup_get_copy_progress_serialize(
        self,
        copies,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'copies': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_backup_get_copy_progress'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_backup_get_copy_progress'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_backup_get_copy_progress',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if copies is not None:
            _form_params += parse_form({'copies': copies})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_backup_submit_copy_form_args(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data from the create copy form, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Handles ajax submission of course copy form.

        Handles ajax submission of course copy form.

        :param jsonformdata: The data from the create copy form, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_submit_copy_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_backup_submit_copy_form(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data from the create copy form, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """Handles ajax submission of course copy form.

        Handles ajax submission of course copy form.

        :param jsonformdata: The data from the create copy form, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_submit_copy_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_backup_submit_copy_form_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_backup_submit_copy_form_with_http_info(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data from the create copy form, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """Handles ajax submission of course copy form.

        Handles ajax submission of course copy form.

        :param jsonformdata: The data from the create copy form, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_submit_copy_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_backup_submit_copy_form_without_preload_content(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data from the create copy form, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Handles ajax submission of course copy form.

        Handles ajax submission of course copy form.

        :param jsonformdata: The data from the create copy form, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_backup_submit_copy_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_backup_submit_copy_form_serialize(
        self,
        jsonformdata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_backup_submit_copy_form'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_backup_submit_copy_form'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_backup_submit_copy_form',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if jsonformdata is not None:
            _form_params += parse_form({'jsonformdata': jsonformdata})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_badges_disable_badges_args(
        self,
        badgeids: List[Optional[StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Disable badges

        Disable badges

        :param badgeids: (required)
        :type badgeids: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_disable_badges_serialize(
            badgeids=badgeids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesDisableBadgesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_badges_disable_badges(
        self,
        badgeids: List[Optional[StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreBadgesDisableBadgesResponse:
        """Disable badges

        Disable badges

        :param badgeids: (required)
        :type badgeids: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_disable_badges_serialize(
            badgeids=badgeids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesDisableBadgesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_badges_disable_badges_from_args(
        self,
        args
    ) -> CoreBadgesDisableBadgesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesDisableBadgesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_badges_disable_badges_with_http_info(
        self,
        badgeids: List[Optional[StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreBadgesDisableBadgesResponse]:
        """Disable badges

        Disable badges

        :param badgeids: (required)
        :type badgeids: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_disable_badges_serialize(
            badgeids=badgeids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesDisableBadgesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_badges_disable_badges_without_preload_content(
        self,
        badgeids: List[Optional[StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Disable badges

        Disable badges

        :param badgeids: (required)
        :type badgeids: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_disable_badges_serialize(
            badgeids=badgeids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesDisableBadgesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_badges_disable_badges_serialize(
        self,
        badgeids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'badgeids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_badges_disable_badges'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_badges_disable_badges'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_badges_disable_badges',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if badgeids is not None:
            _form_params += parse_form({'badgeids': badgeids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_badges_enable_badges_args(
        self,
        badgeids: List[Optional[StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Enable badges

        Enable badges

        :param badgeids: (required)
        :type badgeids: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_enable_badges_serialize(
            badgeids=badgeids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesEnableBadgesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_badges_enable_badges(
        self,
        badgeids: List[Optional[StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreBadgesEnableBadgesResponse:
        """Enable badges

        Enable badges

        :param badgeids: (required)
        :type badgeids: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_enable_badges_serialize(
            badgeids=badgeids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesEnableBadgesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_badges_enable_badges_from_args(
        self,
        args
    ) -> CoreBadgesEnableBadgesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesEnableBadgesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_badges_enable_badges_with_http_info(
        self,
        badgeids: List[Optional[StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreBadgesEnableBadgesResponse]:
        """Enable badges

        Enable badges

        :param badgeids: (required)
        :type badgeids: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_enable_badges_serialize(
            badgeids=badgeids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesEnableBadgesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_badges_enable_badges_without_preload_content(
        self,
        badgeids: List[Optional[StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Enable badges

        Enable badges

        :param badgeids: (required)
        :type badgeids: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_enable_badges_serialize(
            badgeids=badgeids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesEnableBadgesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_badges_enable_badges_serialize(
        self,
        badgeids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'badgeids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_badges_enable_badges'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_badges_enable_badges'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_badges_enable_badges',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if badgeids is not None:
            _form_params += parse_form({'badgeids': badgeids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_badges_get_badge_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Badge id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves a badge by id.

        Retrieves a badge by id.

        :param id: Badge id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_get_badge_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesGetBadgeResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_badges_get_badge(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Badge id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreBadgesGetBadgeResponse:
        """Retrieves a badge by id.

        Retrieves a badge by id.

        :param id: Badge id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_get_badge_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesGetBadgeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_badges_get_badge_from_args(
        self,
        args
    ) -> CoreBadgesGetBadgeResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesGetBadgeResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_badges_get_badge_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Badge id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreBadgesGetBadgeResponse]:
        """Retrieves a badge by id.

        Retrieves a badge by id.

        :param id: Badge id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_get_badge_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesGetBadgeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_badges_get_badge_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Badge id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves a badge by id.

        Retrieves a badge by id.

        :param id: Badge id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_get_badge_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesGetBadgeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_badges_get_badge_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_badges_get_badge'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_badges_get_badge'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_badges_get_badge',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_badges_get_user_badge_by_hash_args(
        self,
        hash: Annotated[Optional[StrictStr], Field(description="Badge issued hash")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the badge awarded to a user by hash.

        Returns the badge awarded to a user by hash.

        :param hash: Badge issued hash (required)
        :type hash: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_get_user_badge_by_hash_serialize(
            hash=hash,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesGetUserBadgeByHashResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_badges_get_user_badge_by_hash(
        self,
        hash: Annotated[Optional[StrictStr], Field(description="Badge issued hash")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreBadgesGetUserBadgeByHashResponse:
        """Returns the badge awarded to a user by hash.

        Returns the badge awarded to a user by hash.

        :param hash: Badge issued hash (required)
        :type hash: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_get_user_badge_by_hash_serialize(
            hash=hash,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesGetUserBadgeByHashResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_badges_get_user_badge_by_hash_from_args(
        self,
        args
    ) -> CoreBadgesGetUserBadgeByHashResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesGetUserBadgeByHashResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_badges_get_user_badge_by_hash_with_http_info(
        self,
        hash: Annotated[Optional[StrictStr], Field(description="Badge issued hash")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreBadgesGetUserBadgeByHashResponse]:
        """Returns the badge awarded to a user by hash.

        Returns the badge awarded to a user by hash.

        :param hash: Badge issued hash (required)
        :type hash: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_get_user_badge_by_hash_serialize(
            hash=hash,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesGetUserBadgeByHashResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_badges_get_user_badge_by_hash_without_preload_content(
        self,
        hash: Annotated[Optional[StrictStr], Field(description="Badge issued hash")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the badge awarded to a user by hash.

        Returns the badge awarded to a user by hash.

        :param hash: Badge issued hash (required)
        :type hash: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_get_user_badge_by_hash_serialize(
            hash=hash,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesGetUserBadgeByHashResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_badges_get_user_badge_by_hash_serialize(
        self,
        hash,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_badges_get_user_badge_by_hash'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_badges_get_user_badge_by_hash'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_badges_get_user_badge_by_hash',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if hash is not None:
            _form_params += parse_form({'hash': hash})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_badges_get_user_badges_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Filter badges by course id, empty all the courses")] = None,
        onlypublic: Annotated[Optional[StrictBool], Field(description="Whether to return only public badges")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page")] = None,
        search: Annotated[Optional[StrictStr], Field(description="A simple string to search for")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Badges only for this user id, empty for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the list of badges awarded to a user.

        Returns the list of badges awarded to a user.

        :param courseid: Filter badges by course id, empty all the courses
        :type courseid: int
        :param onlypublic: Whether to return only public badges
        :type onlypublic: bool
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page
        :type perpage: int
        :param search: A simple string to search for
        :type search: str
        :param userid: Badges only for this user id, empty for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_get_user_badges_serialize(
            courseid=courseid,
            onlypublic=onlypublic,
            page=page,
            perpage=perpage,
            search=search,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesGetUserBadgesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_badges_get_user_badges(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Filter badges by course id, empty all the courses")] = None,
        onlypublic: Annotated[Optional[StrictBool], Field(description="Whether to return only public badges")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page")] = None,
        search: Annotated[Optional[StrictStr], Field(description="A simple string to search for")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Badges only for this user id, empty for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreBadgesGetUserBadgesResponse:
        """Returns the list of badges awarded to a user.

        Returns the list of badges awarded to a user.

        :param courseid: Filter badges by course id, empty all the courses
        :type courseid: int
        :param onlypublic: Whether to return only public badges
        :type onlypublic: bool
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page
        :type perpage: int
        :param search: A simple string to search for
        :type search: str
        :param userid: Badges only for this user id, empty for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_get_user_badges_serialize(
            courseid=courseid,
            onlypublic=onlypublic,
            page=page,
            perpage=perpage,
            search=search,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesGetUserBadgesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_badges_get_user_badges_from_args(
        self,
        args
    ) -> CoreBadgesGetUserBadgesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesGetUserBadgesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_badges_get_user_badges_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Filter badges by course id, empty all the courses")] = None,
        onlypublic: Annotated[Optional[StrictBool], Field(description="Whether to return only public badges")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page")] = None,
        search: Annotated[Optional[StrictStr], Field(description="A simple string to search for")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Badges only for this user id, empty for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreBadgesGetUserBadgesResponse]:
        """Returns the list of badges awarded to a user.

        Returns the list of badges awarded to a user.

        :param courseid: Filter badges by course id, empty all the courses
        :type courseid: int
        :param onlypublic: Whether to return only public badges
        :type onlypublic: bool
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page
        :type perpage: int
        :param search: A simple string to search for
        :type search: str
        :param userid: Badges only for this user id, empty for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_get_user_badges_serialize(
            courseid=courseid,
            onlypublic=onlypublic,
            page=page,
            perpage=perpage,
            search=search,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesGetUserBadgesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_badges_get_user_badges_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Filter badges by course id, empty all the courses")] = None,
        onlypublic: Annotated[Optional[StrictBool], Field(description="Whether to return only public badges")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page")] = None,
        search: Annotated[Optional[StrictStr], Field(description="A simple string to search for")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Badges only for this user id, empty for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the list of badges awarded to a user.

        Returns the list of badges awarded to a user.

        :param courseid: Filter badges by course id, empty all the courses
        :type courseid: int
        :param onlypublic: Whether to return only public badges
        :type onlypublic: bool
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page
        :type perpage: int
        :param search: A simple string to search for
        :type search: str
        :param userid: Badges only for this user id, empty for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_badges_get_user_badges_serialize(
            courseid=courseid,
            onlypublic=onlypublic,
            page=page,
            perpage=perpage,
            search=search,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBadgesGetUserBadgesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_badges_get_user_badges_serialize(
        self,
        courseid,
        onlypublic,
        page,
        perpage,
        search,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_badges_get_user_badges'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_badges_get_user_badges'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_badges_get_user_badges',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if onlypublic is not None:
            _form_params += parse_form({'onlypublic': onlypublic})
        if page is not None:
            _form_params += parse_form({'page': page})
        if perpage is not None:
            _form_params += parse_form({'perpage': perpage})
        if search is not None:
            _form_params += parse_form({'search': search})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_block_fetch_addable_blocks_args(
        self,
        pagecontextid: Annotated[Optional[StrictInt], Field(description="The context ID of the page.")],
        pagelayout: Annotated[Optional[StrictStr], Field(description="The layout of the page.")],
        pagetype: Annotated[Optional[StrictStr], Field(description="The type of the page.")],
        pagehash: Annotated[Optional[StrictStr], Field(description="Page hash")] = None,
        subpage: Annotated[Optional[StrictStr], Field(description="The subpage identifier")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns all addable blocks in a given page.

        Returns all addable blocks in a given page.

        :param pagecontextid: The context ID of the page. (required)
        :type pagecontextid: int
        :param pagelayout: The layout of the page. (required)
        :type pagelayout: str
        :param pagetype: The type of the page. (required)
        :type pagetype: str
        :param pagehash: Page hash
        :type pagehash: str
        :param subpage: The subpage identifier
        :type subpage: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_block_fetch_addable_blocks_serialize(
            pagecontextid=pagecontextid,
            pagelayout=pagelayout,
            pagetype=pagetype,
            pagehash=pagehash,
            subpage=subpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreBlockFetchAddableBlocksResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_block_fetch_addable_blocks(
        self,
        pagecontextid: Annotated[Optional[StrictInt], Field(description="The context ID of the page.")],
        pagelayout: Annotated[Optional[StrictStr], Field(description="The layout of the page.")],
        pagetype: Annotated[Optional[StrictStr], Field(description="The type of the page.")],
        pagehash: Annotated[Optional[StrictStr], Field(description="Page hash")] = None,
        subpage: Annotated[Optional[StrictStr], Field(description="The subpage identifier")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreBlockFetchAddableBlocksResponseInner]:
        """Returns all addable blocks in a given page.

        Returns all addable blocks in a given page.

        :param pagecontextid: The context ID of the page. (required)
        :type pagecontextid: int
        :param pagelayout: The layout of the page. (required)
        :type pagelayout: str
        :param pagetype: The type of the page. (required)
        :type pagetype: str
        :param pagehash: Page hash
        :type pagehash: str
        :param subpage: The subpage identifier
        :type subpage: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_block_fetch_addable_blocks_serialize(
            pagecontextid=pagecontextid,
            pagelayout=pagelayout,
            pagetype=pagetype,
            pagehash=pagehash,
            subpage=subpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreBlockFetchAddableBlocksResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_block_fetch_addable_blocks_from_args(
        self,
        args
    ) -> List[CoreBlockFetchAddableBlocksResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreBlockFetchAddableBlocksResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_block_fetch_addable_blocks_with_http_info(
        self,
        pagecontextid: Annotated[Optional[StrictInt], Field(description="The context ID of the page.")],
        pagelayout: Annotated[Optional[StrictStr], Field(description="The layout of the page.")],
        pagetype: Annotated[Optional[StrictStr], Field(description="The type of the page.")],
        pagehash: Annotated[Optional[StrictStr], Field(description="Page hash")] = None,
        subpage: Annotated[Optional[StrictStr], Field(description="The subpage identifier")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreBlockFetchAddableBlocksResponseInner]]:
        """Returns all addable blocks in a given page.

        Returns all addable blocks in a given page.

        :param pagecontextid: The context ID of the page. (required)
        :type pagecontextid: int
        :param pagelayout: The layout of the page. (required)
        :type pagelayout: str
        :param pagetype: The type of the page. (required)
        :type pagetype: str
        :param pagehash: Page hash
        :type pagehash: str
        :param subpage: The subpage identifier
        :type subpage: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_block_fetch_addable_blocks_serialize(
            pagecontextid=pagecontextid,
            pagelayout=pagelayout,
            pagetype=pagetype,
            pagehash=pagehash,
            subpage=subpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreBlockFetchAddableBlocksResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_block_fetch_addable_blocks_without_preload_content(
        self,
        pagecontextid: Annotated[Optional[StrictInt], Field(description="The context ID of the page.")],
        pagelayout: Annotated[Optional[StrictStr], Field(description="The layout of the page.")],
        pagetype: Annotated[Optional[StrictStr], Field(description="The type of the page.")],
        pagehash: Annotated[Optional[StrictStr], Field(description="Page hash")] = None,
        subpage: Annotated[Optional[StrictStr], Field(description="The subpage identifier")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns all addable blocks in a given page.

        Returns all addable blocks in a given page.

        :param pagecontextid: The context ID of the page. (required)
        :type pagecontextid: int
        :param pagelayout: The layout of the page. (required)
        :type pagelayout: str
        :param pagetype: The type of the page. (required)
        :type pagetype: str
        :param pagehash: Page hash
        :type pagehash: str
        :param subpage: The subpage identifier
        :type subpage: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_block_fetch_addable_blocks_serialize(
            pagecontextid=pagecontextid,
            pagelayout=pagelayout,
            pagetype=pagetype,
            pagehash=pagehash,
            subpage=subpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreBlockFetchAddableBlocksResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_block_fetch_addable_blocks_serialize(
        self,
        pagecontextid,
        pagelayout,
        pagetype,
        pagehash,
        subpage,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_block_fetch_addable_blocks'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_block_fetch_addable_blocks'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_block_fetch_addable_blocks',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if pagecontextid is not None:
            _form_params += parse_form({'pagecontextid': pagecontextid})
        if pagehash is not None:
            _form_params += parse_form({'pagehash': pagehash})
        if pagelayout is not None:
            _form_params += parse_form({'pagelayout': pagelayout})
        if pagetype is not None:
            _form_params += parse_form({'pagetype': pagetype})
        if subpage is not None:
            _form_params += parse_form({'subpage': subpage})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_block_get_course_blocks_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return the block contents.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns blocks information for a course.

        Returns blocks information for a course.

        :param courseid: course id (required)
        :type courseid: int
        :param returncontents: Whether to return the block contents.
        :type returncontents: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_block_get_course_blocks_serialize(
            courseid=courseid,
            returncontents=returncontents,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlockGetCourseBlocksResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_block_get_course_blocks(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return the block contents.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreBlockGetCourseBlocksResponse:
        """Returns blocks information for a course.

        Returns blocks information for a course.

        :param courseid: course id (required)
        :type courseid: int
        :param returncontents: Whether to return the block contents.
        :type returncontents: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_block_get_course_blocks_serialize(
            courseid=courseid,
            returncontents=returncontents,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlockGetCourseBlocksResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_block_get_course_blocks_from_args(
        self,
        args
    ) -> CoreBlockGetCourseBlocksResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlockGetCourseBlocksResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_block_get_course_blocks_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return the block contents.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreBlockGetCourseBlocksResponse]:
        """Returns blocks information for a course.

        Returns blocks information for a course.

        :param courseid: course id (required)
        :type courseid: int
        :param returncontents: Whether to return the block contents.
        :type returncontents: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_block_get_course_blocks_serialize(
            courseid=courseid,
            returncontents=returncontents,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlockGetCourseBlocksResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_block_get_course_blocks_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return the block contents.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns blocks information for a course.

        Returns blocks information for a course.

        :param courseid: course id (required)
        :type courseid: int
        :param returncontents: Whether to return the block contents.
        :type returncontents: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_block_get_course_blocks_serialize(
            courseid=courseid,
            returncontents=returncontents,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlockGetCourseBlocksResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_block_get_course_blocks_serialize(
        self,
        courseid,
        returncontents,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_block_get_course_blocks'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_block_get_course_blocks'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_block_get_course_blocks',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if returncontents is not None:
            _form_params += parse_form({'returncontents': returncontents})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_block_get_dashboard_blocks_args(
        self,
        mypage: Annotated[Optional[StrictStr], Field(description="What my page to return blocks of")] = None,
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return the block contents.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="User id (optional), default is current user.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns blocks information for the given user dashboard.

        Returns blocks information for the given user dashboard.

        :param mypage: What my page to return blocks of
        :type mypage: str
        :param returncontents: Whether to return the block contents.
        :type returncontents: bool
        :param userid: User id (optional), default is current user.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_block_get_dashboard_blocks_serialize(
            mypage=mypage,
            returncontents=returncontents,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlockGetDashboardBlocksResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_block_get_dashboard_blocks(
        self,
        mypage: Annotated[Optional[StrictStr], Field(description="What my page to return blocks of")] = None,
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return the block contents.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="User id (optional), default is current user.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreBlockGetDashboardBlocksResponse:
        """Returns blocks information for the given user dashboard.

        Returns blocks information for the given user dashboard.

        :param mypage: What my page to return blocks of
        :type mypage: str
        :param returncontents: Whether to return the block contents.
        :type returncontents: bool
        :param userid: User id (optional), default is current user.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_block_get_dashboard_blocks_serialize(
            mypage=mypage,
            returncontents=returncontents,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlockGetDashboardBlocksResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_block_get_dashboard_blocks_from_args(
        self,
        args
    ) -> CoreBlockGetDashboardBlocksResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlockGetDashboardBlocksResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_block_get_dashboard_blocks_with_http_info(
        self,
        mypage: Annotated[Optional[StrictStr], Field(description="What my page to return blocks of")] = None,
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return the block contents.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="User id (optional), default is current user.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreBlockGetDashboardBlocksResponse]:
        """Returns blocks information for the given user dashboard.

        Returns blocks information for the given user dashboard.

        :param mypage: What my page to return blocks of
        :type mypage: str
        :param returncontents: Whether to return the block contents.
        :type returncontents: bool
        :param userid: User id (optional), default is current user.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_block_get_dashboard_blocks_serialize(
            mypage=mypage,
            returncontents=returncontents,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlockGetDashboardBlocksResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_block_get_dashboard_blocks_without_preload_content(
        self,
        mypage: Annotated[Optional[StrictStr], Field(description="What my page to return blocks of")] = None,
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return the block contents.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="User id (optional), default is current user.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns blocks information for the given user dashboard.

        Returns blocks information for the given user dashboard.

        :param mypage: What my page to return blocks of
        :type mypage: str
        :param returncontents: Whether to return the block contents.
        :type returncontents: bool
        :param userid: User id (optional), default is current user.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_block_get_dashboard_blocks_serialize(
            mypage=mypage,
            returncontents=returncontents,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlockGetDashboardBlocksResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_block_get_dashboard_blocks_serialize(
        self,
        mypage,
        returncontents,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_block_get_dashboard_blocks'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_block_get_dashboard_blocks'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_block_get_dashboard_blocks',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if mypage is not None:
            _form_params += parse_form({'mypage': mypage})
        if returncontents is not None:
            _form_params += parse_form({'returncontents': returncontents})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_blog_add_entry_args(
        self,
        subject: Annotated[Optional[StrictStr], Field(description="Blog subject")],
        summary: Annotated[Optional[StrictStr], Field(description="Blog post content")],
        summaryformat: Annotated[Optional[StrictInt], Field(description="summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")],
        options: Annotated[Optional[List[CoreBlogAddEntryParametersOptionsInner]], Field(description="Optional settings")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Creates a new blog post entry.

        Creates a new blog post entry.

        :param subject: Blog subject (required)
        :type subject: str
        :param summary: Blog post content (required)
        :type summary: str
        :param summaryformat: summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN) (required)
        :type summaryformat: int
        :param options: Optional settings
        :type options: List[CoreBlogAddEntryParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_add_entry_serialize(
            subject=subject,
            summary=summary,
            summaryformat=summaryformat,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogAddEntryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_blog_add_entry(
        self,
        subject: Annotated[Optional[StrictStr], Field(description="Blog subject")],
        summary: Annotated[Optional[StrictStr], Field(description="Blog post content")],
        summaryformat: Annotated[Optional[StrictInt], Field(description="summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")],
        options: Annotated[Optional[List[CoreBlogAddEntryParametersOptionsInner]], Field(description="Optional settings")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreBlogAddEntryResponse:
        """Creates a new blog post entry.

        Creates a new blog post entry.

        :param subject: Blog subject (required)
        :type subject: str
        :param summary: Blog post content (required)
        :type summary: str
        :param summaryformat: summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN) (required)
        :type summaryformat: int
        :param options: Optional settings
        :type options: List[CoreBlogAddEntryParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_add_entry_serialize(
            subject=subject,
            summary=summary,
            summaryformat=summaryformat,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogAddEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_blog_add_entry_from_args(
        self,
        args
    ) -> CoreBlogAddEntryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogAddEntryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_blog_add_entry_with_http_info(
        self,
        subject: Annotated[Optional[StrictStr], Field(description="Blog subject")],
        summary: Annotated[Optional[StrictStr], Field(description="Blog post content")],
        summaryformat: Annotated[Optional[StrictInt], Field(description="summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")],
        options: Annotated[Optional[List[CoreBlogAddEntryParametersOptionsInner]], Field(description="Optional settings")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreBlogAddEntryResponse]:
        """Creates a new blog post entry.

        Creates a new blog post entry.

        :param subject: Blog subject (required)
        :type subject: str
        :param summary: Blog post content (required)
        :type summary: str
        :param summaryformat: summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN) (required)
        :type summaryformat: int
        :param options: Optional settings
        :type options: List[CoreBlogAddEntryParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_add_entry_serialize(
            subject=subject,
            summary=summary,
            summaryformat=summaryformat,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogAddEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_blog_add_entry_without_preload_content(
        self,
        subject: Annotated[Optional[StrictStr], Field(description="Blog subject")],
        summary: Annotated[Optional[StrictStr], Field(description="Blog post content")],
        summaryformat: Annotated[Optional[StrictInt], Field(description="summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")],
        options: Annotated[Optional[List[CoreBlogAddEntryParametersOptionsInner]], Field(description="Optional settings")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Creates a new blog post entry.

        Creates a new blog post entry.

        :param subject: Blog subject (required)
        :type subject: str
        :param summary: Blog post content (required)
        :type summary: str
        :param summaryformat: summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN) (required)
        :type summaryformat: int
        :param options: Optional settings
        :type options: List[CoreBlogAddEntryParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_add_entry_serialize(
            subject=subject,
            summary=summary,
            summaryformat=summaryformat,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogAddEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_blog_add_entry_serialize(
        self,
        subject,
        summary,
        summaryformat,
        options,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'options': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_blog_add_entry'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_blog_add_entry'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_blog_add_entry',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if options is not None:
            _form_params += parse_form({'options': options})
        if subject is not None:
            _form_params += parse_form({'subject': subject})
        if summary is not None:
            _form_params += parse_form({'summary': summary})
        if summaryformat is not None:
            _form_params += parse_form({'summaryformat': summaryformat})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_blog_delete_entry_args(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="The entry id to remove.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes a blog post entry.

        Deletes a blog post entry.

        :param entryid: The entry id to remove. (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_delete_entry_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogDeleteEntryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_blog_delete_entry(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="The entry id to remove.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreBlogDeleteEntryResponse:
        """Deletes a blog post entry.

        Deletes a blog post entry.

        :param entryid: The entry id to remove. (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_delete_entry_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogDeleteEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_blog_delete_entry_from_args(
        self,
        args
    ) -> CoreBlogDeleteEntryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogDeleteEntryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_blog_delete_entry_with_http_info(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="The entry id to remove.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreBlogDeleteEntryResponse]:
        """Deletes a blog post entry.

        Deletes a blog post entry.

        :param entryid: The entry id to remove. (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_delete_entry_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogDeleteEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_blog_delete_entry_without_preload_content(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="The entry id to remove.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes a blog post entry.

        Deletes a blog post entry.

        :param entryid: The entry id to remove. (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_delete_entry_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogDeleteEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_blog_delete_entry_serialize(
        self,
        entryid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_blog_delete_entry'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_blog_delete_entry'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_blog_delete_entry',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if entryid is not None:
            _form_params += parse_form({'entryid': entryid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_blog_get_access_information_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves permission information for the current user.

        Retrieves permission information for the current user.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_get_access_information_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogGetAccessInformationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_blog_get_access_information(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreBlogGetAccessInformationResponse:
        """Retrieves permission information for the current user.

        Retrieves permission information for the current user.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_get_access_information_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogGetAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_blog_get_access_information_from_args(
        self,
        args
    ) -> CoreBlogGetAccessInformationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogGetAccessInformationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_blog_get_access_information_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreBlogGetAccessInformationResponse]:
        """Retrieves permission information for the current user.

        Retrieves permission information for the current user.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_get_access_information_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogGetAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_blog_get_access_information_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves permission information for the current user.

        Retrieves permission information for the current user.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_get_access_information_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogGetAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_blog_get_access_information_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_blog_get_access_information'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_blog_get_access_information'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_blog_get_access_information',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_blog_get_entries_args(
        self,
        args: CoreBlogGetEntriesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns blog entries.

        Returns blog entries.

        :param args: (required)
        :type args: CoreBlogGetEntriesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_get_entries_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogGetEntriesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_blog_get_entries(
        self,
        args: CoreBlogGetEntriesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreBlogGetEntriesResponse:
        """Returns blog entries.

        Returns blog entries.

        :param args: (required)
        :type args: CoreBlogGetEntriesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_get_entries_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogGetEntriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_blog_get_entries_from_args(
        self,
        args
    ) -> CoreBlogGetEntriesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogGetEntriesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_blog_get_entries_with_http_info(
        self,
        args: CoreBlogGetEntriesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreBlogGetEntriesResponse]:
        """Returns blog entries.

        Returns blog entries.

        :param args: (required)
        :type args: CoreBlogGetEntriesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_get_entries_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogGetEntriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_blog_get_entries_without_preload_content(
        self,
        args: CoreBlogGetEntriesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns blog entries.

        Returns blog entries.

        :param args: (required)
        :type args: CoreBlogGetEntriesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_get_entries_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogGetEntriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_blog_get_entries_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#core_blog_get_entries'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_blog_get_entries'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_blog_get_entries',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_blog_prepare_entry_for_edition_args(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="The entry id to edit.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Prepare a draft area for editing a blog entry..

        Prepare a draft area for editing a blog entry..

        :param entryid: The entry id to edit. (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_prepare_entry_for_edition_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogPrepareEntryForEditionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_blog_prepare_entry_for_edition(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="The entry id to edit.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreBlogPrepareEntryForEditionResponse:
        """Prepare a draft area for editing a blog entry..

        Prepare a draft area for editing a blog entry..

        :param entryid: The entry id to edit. (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_prepare_entry_for_edition_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogPrepareEntryForEditionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_blog_prepare_entry_for_edition_from_args(
        self,
        args
    ) -> CoreBlogPrepareEntryForEditionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogPrepareEntryForEditionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_blog_prepare_entry_for_edition_with_http_info(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="The entry id to edit.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreBlogPrepareEntryForEditionResponse]:
        """Prepare a draft area for editing a blog entry..

        Prepare a draft area for editing a blog entry..

        :param entryid: The entry id to edit. (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_prepare_entry_for_edition_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogPrepareEntryForEditionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_blog_prepare_entry_for_edition_without_preload_content(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="The entry id to edit.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Prepare a draft area for editing a blog entry..

        Prepare a draft area for editing a blog entry..

        :param entryid: The entry id to edit. (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_prepare_entry_for_edition_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogPrepareEntryForEditionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_blog_prepare_entry_for_edition_serialize(
        self,
        entryid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_blog_prepare_entry_for_edition'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_blog_prepare_entry_for_edition'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_blog_prepare_entry_for_edition',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if entryid is not None:
            _form_params += parse_form({'entryid': entryid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_blog_update_entry_args(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Blog entry id to update")],
        subject: Annotated[Optional[StrictStr], Field(description="Blog subject")],
        summary: Annotated[Optional[StrictStr], Field(description="Blog post content")],
        summaryformat: Annotated[Optional[StrictInt], Field(description="summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")],
        options: Annotated[Optional[List[CoreBlogAddEntryParametersOptionsInner]], Field(description="Optional settings")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Updates a blog entry.

        Updates a blog entry.

        :param entryid: Blog entry id to update (required)
        :type entryid: int
        :param subject: Blog subject (required)
        :type subject: str
        :param summary: Blog post content (required)
        :type summary: str
        :param summaryformat: summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN) (required)
        :type summaryformat: int
        :param options: Optional settings
        :type options: List[CoreBlogAddEntryParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_update_entry_serialize(
            entryid=entryid,
            subject=subject,
            summary=summary,
            summaryformat=summaryformat,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogUpdateEntryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_blog_update_entry(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Blog entry id to update")],
        subject: Annotated[Optional[StrictStr], Field(description="Blog subject")],
        summary: Annotated[Optional[StrictStr], Field(description="Blog post content")],
        summaryformat: Annotated[Optional[StrictInt], Field(description="summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")],
        options: Annotated[Optional[List[CoreBlogAddEntryParametersOptionsInner]], Field(description="Optional settings")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreBlogUpdateEntryResponse:
        """Updates a blog entry.

        Updates a blog entry.

        :param entryid: Blog entry id to update (required)
        :type entryid: int
        :param subject: Blog subject (required)
        :type subject: str
        :param summary: Blog post content (required)
        :type summary: str
        :param summaryformat: summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN) (required)
        :type summaryformat: int
        :param options: Optional settings
        :type options: List[CoreBlogAddEntryParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_update_entry_serialize(
            entryid=entryid,
            subject=subject,
            summary=summary,
            summaryformat=summaryformat,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogUpdateEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_blog_update_entry_from_args(
        self,
        args
    ) -> CoreBlogUpdateEntryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogUpdateEntryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_blog_update_entry_with_http_info(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Blog entry id to update")],
        subject: Annotated[Optional[StrictStr], Field(description="Blog subject")],
        summary: Annotated[Optional[StrictStr], Field(description="Blog post content")],
        summaryformat: Annotated[Optional[StrictInt], Field(description="summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")],
        options: Annotated[Optional[List[CoreBlogAddEntryParametersOptionsInner]], Field(description="Optional settings")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreBlogUpdateEntryResponse]:
        """Updates a blog entry.

        Updates a blog entry.

        :param entryid: Blog entry id to update (required)
        :type entryid: int
        :param subject: Blog subject (required)
        :type subject: str
        :param summary: Blog post content (required)
        :type summary: str
        :param summaryformat: summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN) (required)
        :type summaryformat: int
        :param options: Optional settings
        :type options: List[CoreBlogAddEntryParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_update_entry_serialize(
            entryid=entryid,
            subject=subject,
            summary=summary,
            summaryformat=summaryformat,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogUpdateEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_blog_update_entry_without_preload_content(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Blog entry id to update")],
        subject: Annotated[Optional[StrictStr], Field(description="Blog subject")],
        summary: Annotated[Optional[StrictStr], Field(description="Blog post content")],
        summaryformat: Annotated[Optional[StrictInt], Field(description="summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")],
        options: Annotated[Optional[List[CoreBlogAddEntryParametersOptionsInner]], Field(description="Optional settings")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Updates a blog entry.

        Updates a blog entry.

        :param entryid: Blog entry id to update (required)
        :type entryid: int
        :param subject: Blog subject (required)
        :type subject: str
        :param summary: Blog post content (required)
        :type summary: str
        :param summaryformat: summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN) (required)
        :type summaryformat: int
        :param options: Optional settings
        :type options: List[CoreBlogAddEntryParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_update_entry_serialize(
            entryid=entryid,
            subject=subject,
            summary=summary,
            summaryformat=summaryformat,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogUpdateEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_blog_update_entry_serialize(
        self,
        entryid,
        subject,
        summary,
        summaryformat,
        options,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'options': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_blog_update_entry'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_blog_update_entry'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_blog_update_entry',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if entryid is not None:
            _form_params += parse_form({'entryid': entryid})
        if options is not None:
            _form_params += parse_form({'options': options})
        if subject is not None:
            _form_params += parse_form({'subject': subject})
        if summary is not None:
            _form_params += parse_form({'summary': summary})
        if summaryformat is not None:
            _form_params += parse_form({'summaryformat': summaryformat})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_blog_view_entries_args(
        self,
        args: CoreBlogViewEntriesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the blog_entries_viewed event.

        Trigger the blog_entries_viewed event.

        :param args: (required)
        :type args: CoreBlogViewEntriesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_view_entries_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogViewEntriesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_blog_view_entries(
        self,
        args: CoreBlogViewEntriesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreBlogViewEntriesResponse:
        """Trigger the blog_entries_viewed event.

        Trigger the blog_entries_viewed event.

        :param args: (required)
        :type args: CoreBlogViewEntriesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_view_entries_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogViewEntriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_blog_view_entries_from_args(
        self,
        args
    ) -> CoreBlogViewEntriesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogViewEntriesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_blog_view_entries_with_http_info(
        self,
        args: CoreBlogViewEntriesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreBlogViewEntriesResponse]:
        """Trigger the blog_entries_viewed event.

        Trigger the blog_entries_viewed event.

        :param args: (required)
        :type args: CoreBlogViewEntriesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_view_entries_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogViewEntriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_blog_view_entries_without_preload_content(
        self,
        args: CoreBlogViewEntriesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the blog_entries_viewed event.

        Trigger the blog_entries_viewed event.

        :param args: (required)
        :type args: CoreBlogViewEntriesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_blog_view_entries_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreBlogViewEntriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_blog_view_entries_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#core_blog_view_entries'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_blog_view_entries'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_blog_view_entries',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_create_calendar_events_args(
        self,
        events: List[CoreCalendarCreateCalendarEventsParametersEventsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Create calendar events

        Create calendar events

        :param events: (required)
        :type events: List[CoreCalendarCreateCalendarEventsParametersEventsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_create_calendar_events_serialize(
            events=events,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarCreateCalendarEventsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_create_calendar_events(
        self,
        events: List[CoreCalendarCreateCalendarEventsParametersEventsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCalendarCreateCalendarEventsResponse:
        """Create calendar events

        Create calendar events

        :param events: (required)
        :type events: List[CoreCalendarCreateCalendarEventsParametersEventsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_create_calendar_events_serialize(
            events=events,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarCreateCalendarEventsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_create_calendar_events_from_args(
        self,
        args
    ) -> CoreCalendarCreateCalendarEventsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarCreateCalendarEventsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_create_calendar_events_with_http_info(
        self,
        events: List[CoreCalendarCreateCalendarEventsParametersEventsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCalendarCreateCalendarEventsResponse]:
        """Create calendar events

        Create calendar events

        :param events: (required)
        :type events: List[CoreCalendarCreateCalendarEventsParametersEventsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_create_calendar_events_serialize(
            events=events,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarCreateCalendarEventsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_create_calendar_events_without_preload_content(
        self,
        events: List[CoreCalendarCreateCalendarEventsParametersEventsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create calendar events

        Create calendar events

        :param events: (required)
        :type events: List[CoreCalendarCreateCalendarEventsParametersEventsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_create_calendar_events_serialize(
            events=events,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarCreateCalendarEventsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_create_calendar_events_serialize(
        self,
        events,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'events': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_create_calendar_events'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_create_calendar_events'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_create_calendar_events',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if events is not None:
            _form_params += parse_form({'events': events})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_delete_calendar_events_args(
        self,
        events: List[CoreCalendarDeleteCalendarEventsParametersEventsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete calendar events

        Delete calendar events

        :param events: (required)
        :type events: List[CoreCalendarDeleteCalendarEventsParametersEventsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_delete_calendar_events_serialize(
            events=events,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_delete_calendar_events(
        self,
        events: List[CoreCalendarDeleteCalendarEventsParametersEventsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Delete calendar events

        Delete calendar events

        :param events: (required)
        :type events: List[CoreCalendarDeleteCalendarEventsParametersEventsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_delete_calendar_events_serialize(
            events=events,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_delete_calendar_events_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_delete_calendar_events_with_http_info(
        self,
        events: List[CoreCalendarDeleteCalendarEventsParametersEventsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Delete calendar events

        Delete calendar events

        :param events: (required)
        :type events: List[CoreCalendarDeleteCalendarEventsParametersEventsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_delete_calendar_events_serialize(
            events=events,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_delete_calendar_events_without_preload_content(
        self,
        events: List[CoreCalendarDeleteCalendarEventsParametersEventsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete calendar events

        Delete calendar events

        :param events: (required)
        :type events: List[CoreCalendarDeleteCalendarEventsParametersEventsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_delete_calendar_events_serialize(
            events=events,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_delete_calendar_events_serialize(
        self,
        events,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'events': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_delete_calendar_events'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_delete_calendar_events'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_delete_calendar_events',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if events is not None:
            _form_params += parse_form({'events': events})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_delete_subscription_args(
        self,
        subscriptionid: Annotated[Optional[StrictInt], Field(description="The id of the subscription")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete the calendar subscription

        Delete the calendar subscription

        :param subscriptionid: The id of the subscription (required)
        :type subscriptionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_delete_subscription_serialize(
            subscriptionid=subscriptionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarDeleteSubscriptionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_delete_subscription(
        self,
        subscriptionid: Annotated[Optional[StrictInt], Field(description="The id of the subscription")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCalendarDeleteSubscriptionResponse:
        """Delete the calendar subscription

        Delete the calendar subscription

        :param subscriptionid: The id of the subscription (required)
        :type subscriptionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_delete_subscription_serialize(
            subscriptionid=subscriptionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarDeleteSubscriptionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_delete_subscription_from_args(
        self,
        args
    ) -> CoreCalendarDeleteSubscriptionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarDeleteSubscriptionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_delete_subscription_with_http_info(
        self,
        subscriptionid: Annotated[Optional[StrictInt], Field(description="The id of the subscription")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCalendarDeleteSubscriptionResponse]:
        """Delete the calendar subscription

        Delete the calendar subscription

        :param subscriptionid: The id of the subscription (required)
        :type subscriptionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_delete_subscription_serialize(
            subscriptionid=subscriptionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarDeleteSubscriptionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_delete_subscription_without_preload_content(
        self,
        subscriptionid: Annotated[Optional[StrictInt], Field(description="The id of the subscription")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete the calendar subscription

        Delete the calendar subscription

        :param subscriptionid: The id of the subscription (required)
        :type subscriptionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_delete_subscription_serialize(
            subscriptionid=subscriptionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarDeleteSubscriptionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_delete_subscription_serialize(
        self,
        subscriptionid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_delete_subscription'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_delete_subscription'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_delete_subscription',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if subscriptionid is not None:
            _form_params += parse_form({'subscriptionid': subscriptionid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_get_action_events_by_course_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id")],
        aftereventid: Annotated[Optional[StrictInt], Field(description="The last seen event id")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        timesortfrom: Annotated[Optional[StrictInt], Field(description="Time sort from")] = None,
        timesortto: Annotated[Optional[StrictInt], Field(description="Time sort to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get calendar action events by course

        Get calendar action events by course

        :param courseid: Course id (required)
        :type courseid: int
        :param aftereventid: The last seen event id
        :type aftereventid: int
        :param limitnum: Limit number
        :type limitnum: int
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param timesortfrom: Time sort from
        :type timesortfrom: int
        :param timesortto: Time sort to
        :type timesortto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_action_events_by_course_serialize(
            courseid=courseid,
            aftereventid=aftereventid,
            limitnum=limitnum,
            searchvalue=searchvalue,
            timesortfrom=timesortfrom,
            timesortto=timesortto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetActionEventsByCourseResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_get_action_events_by_course(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id")],
        aftereventid: Annotated[Optional[StrictInt], Field(description="The last seen event id")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        timesortfrom: Annotated[Optional[StrictInt], Field(description="Time sort from")] = None,
        timesortto: Annotated[Optional[StrictInt], Field(description="Time sort to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCalendarGetActionEventsByCourseResponse:
        """Get calendar action events by course

        Get calendar action events by course

        :param courseid: Course id (required)
        :type courseid: int
        :param aftereventid: The last seen event id
        :type aftereventid: int
        :param limitnum: Limit number
        :type limitnum: int
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param timesortfrom: Time sort from
        :type timesortfrom: int
        :param timesortto: Time sort to
        :type timesortto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_action_events_by_course_serialize(
            courseid=courseid,
            aftereventid=aftereventid,
            limitnum=limitnum,
            searchvalue=searchvalue,
            timesortfrom=timesortfrom,
            timesortto=timesortto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetActionEventsByCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_action_events_by_course_from_args(
        self,
        args
    ) -> CoreCalendarGetActionEventsByCourseResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetActionEventsByCourseResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_action_events_by_course_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id")],
        aftereventid: Annotated[Optional[StrictInt], Field(description="The last seen event id")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        timesortfrom: Annotated[Optional[StrictInt], Field(description="Time sort from")] = None,
        timesortto: Annotated[Optional[StrictInt], Field(description="Time sort to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCalendarGetActionEventsByCourseResponse]:
        """Get calendar action events by course

        Get calendar action events by course

        :param courseid: Course id (required)
        :type courseid: int
        :param aftereventid: The last seen event id
        :type aftereventid: int
        :param limitnum: Limit number
        :type limitnum: int
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param timesortfrom: Time sort from
        :type timesortfrom: int
        :param timesortto: Time sort to
        :type timesortto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_action_events_by_course_serialize(
            courseid=courseid,
            aftereventid=aftereventid,
            limitnum=limitnum,
            searchvalue=searchvalue,
            timesortfrom=timesortfrom,
            timesortto=timesortto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetActionEventsByCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_get_action_events_by_course_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id")],
        aftereventid: Annotated[Optional[StrictInt], Field(description="The last seen event id")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        timesortfrom: Annotated[Optional[StrictInt], Field(description="Time sort from")] = None,
        timesortto: Annotated[Optional[StrictInt], Field(description="Time sort to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get calendar action events by course

        Get calendar action events by course

        :param courseid: Course id (required)
        :type courseid: int
        :param aftereventid: The last seen event id
        :type aftereventid: int
        :param limitnum: Limit number
        :type limitnum: int
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param timesortfrom: Time sort from
        :type timesortfrom: int
        :param timesortto: Time sort to
        :type timesortto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_action_events_by_course_serialize(
            courseid=courseid,
            aftereventid=aftereventid,
            limitnum=limitnum,
            searchvalue=searchvalue,
            timesortfrom=timesortfrom,
            timesortto=timesortto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetActionEventsByCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_get_action_events_by_course_serialize(
        self,
        courseid,
        aftereventid,
        limitnum,
        searchvalue,
        timesortfrom,
        timesortto,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_get_action_events_by_course'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_get_action_events_by_course'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_get_action_events_by_course',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if aftereventid is not None:
            _form_params += parse_form({'aftereventid': aftereventid})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if limitnum is not None:
            _form_params += parse_form({'limitnum': limitnum})
        if searchvalue is not None:
            _form_params += parse_form({'searchvalue': searchvalue})
        if timesortfrom is not None:
            _form_params += parse_form({'timesortfrom': timesortfrom})
        if timesortto is not None:
            _form_params += parse_form({'timesortto': timesortto})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_get_action_events_by_courses_args(
        self,
        courseids: List[Optional[StrictInt]],
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        timesortfrom: Annotated[Optional[StrictInt], Field(description="Time sort from")] = None,
        timesortto: Annotated[Optional[StrictInt], Field(description="Time sort to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get calendar action events by courses

        Get calendar action events by courses

        :param courseids: (required)
        :type courseids: List[Optional[int]]
        :param limitnum: Limit number
        :type limitnum: int
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param timesortfrom: Time sort from
        :type timesortfrom: int
        :param timesortto: Time sort to
        :type timesortto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_action_events_by_courses_serialize(
            courseids=courseids,
            limitnum=limitnum,
            searchvalue=searchvalue,
            timesortfrom=timesortfrom,
            timesortto=timesortto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetActionEventsByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_get_action_events_by_courses(
        self,
        courseids: List[Optional[StrictInt]],
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        timesortfrom: Annotated[Optional[StrictInt], Field(description="Time sort from")] = None,
        timesortto: Annotated[Optional[StrictInt], Field(description="Time sort to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCalendarGetActionEventsByCoursesResponse:
        """Get calendar action events by courses

        Get calendar action events by courses

        :param courseids: (required)
        :type courseids: List[Optional[int]]
        :param limitnum: Limit number
        :type limitnum: int
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param timesortfrom: Time sort from
        :type timesortfrom: int
        :param timesortto: Time sort to
        :type timesortto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_action_events_by_courses_serialize(
            courseids=courseids,
            limitnum=limitnum,
            searchvalue=searchvalue,
            timesortfrom=timesortfrom,
            timesortto=timesortto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetActionEventsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_action_events_by_courses_from_args(
        self,
        args
    ) -> CoreCalendarGetActionEventsByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetActionEventsByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_action_events_by_courses_with_http_info(
        self,
        courseids: List[Optional[StrictInt]],
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        timesortfrom: Annotated[Optional[StrictInt], Field(description="Time sort from")] = None,
        timesortto: Annotated[Optional[StrictInt], Field(description="Time sort to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCalendarGetActionEventsByCoursesResponse]:
        """Get calendar action events by courses

        Get calendar action events by courses

        :param courseids: (required)
        :type courseids: List[Optional[int]]
        :param limitnum: Limit number
        :type limitnum: int
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param timesortfrom: Time sort from
        :type timesortfrom: int
        :param timesortto: Time sort to
        :type timesortto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_action_events_by_courses_serialize(
            courseids=courseids,
            limitnum=limitnum,
            searchvalue=searchvalue,
            timesortfrom=timesortfrom,
            timesortto=timesortto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetActionEventsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_get_action_events_by_courses_without_preload_content(
        self,
        courseids: List[Optional[StrictInt]],
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        timesortfrom: Annotated[Optional[StrictInt], Field(description="Time sort from")] = None,
        timesortto: Annotated[Optional[StrictInt], Field(description="Time sort to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get calendar action events by courses

        Get calendar action events by courses

        :param courseids: (required)
        :type courseids: List[Optional[int]]
        :param limitnum: Limit number
        :type limitnum: int
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param timesortfrom: Time sort from
        :type timesortfrom: int
        :param timesortto: Time sort to
        :type timesortto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_action_events_by_courses_serialize(
            courseids=courseids,
            limitnum=limitnum,
            searchvalue=searchvalue,
            timesortfrom=timesortfrom,
            timesortto=timesortto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetActionEventsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_get_action_events_by_courses_serialize(
        self,
        courseids,
        limitnum,
        searchvalue,
        timesortfrom,
        timesortto,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_get_action_events_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_get_action_events_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_get_action_events_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        if limitnum is not None:
            _form_params += parse_form({'limitnum': limitnum})
        if searchvalue is not None:
            _form_params += parse_form({'searchvalue': searchvalue})
        if timesortfrom is not None:
            _form_params += parse_form({'timesortfrom': timesortfrom})
        if timesortto is not None:
            _form_params += parse_form({'timesortto': timesortto})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_get_action_events_by_timesort_args(
        self,
        aftereventid: Annotated[Optional[StrictInt], Field(description="The last seen event id")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        limittononsuspendedevents: Annotated[Optional[StrictBool], Field(description="Limit the events to courses the user is not suspended in")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        timesortfrom: Annotated[Optional[StrictInt], Field(description="Time sort from")] = None,
        timesortto: Annotated[Optional[StrictInt], Field(description="Time sort to")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="The user id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get calendar action events by tiemsort

        Get calendar action events by tiemsort

        :param aftereventid: The last seen event id
        :type aftereventid: int
        :param limitnum: Limit number
        :type limitnum: int
        :param limittononsuspendedevents: Limit the events to courses the user is not suspended in
        :type limittononsuspendedevents: bool
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param timesortfrom: Time sort from
        :type timesortfrom: int
        :param timesortto: Time sort to
        :type timesortto: int
        :param userid: The user id
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_action_events_by_timesort_serialize(
            aftereventid=aftereventid,
            limitnum=limitnum,
            limittononsuspendedevents=limittononsuspendedevents,
            searchvalue=searchvalue,
            timesortfrom=timesortfrom,
            timesortto=timesortto,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetActionEventsByTimesortResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_get_action_events_by_timesort(
        self,
        aftereventid: Annotated[Optional[StrictInt], Field(description="The last seen event id")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        limittononsuspendedevents: Annotated[Optional[StrictBool], Field(description="Limit the events to courses the user is not suspended in")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        timesortfrom: Annotated[Optional[StrictInt], Field(description="Time sort from")] = None,
        timesortto: Annotated[Optional[StrictInt], Field(description="Time sort to")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="The user id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCalendarGetActionEventsByTimesortResponse:
        """Get calendar action events by tiemsort

        Get calendar action events by tiemsort

        :param aftereventid: The last seen event id
        :type aftereventid: int
        :param limitnum: Limit number
        :type limitnum: int
        :param limittononsuspendedevents: Limit the events to courses the user is not suspended in
        :type limittononsuspendedevents: bool
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param timesortfrom: Time sort from
        :type timesortfrom: int
        :param timesortto: Time sort to
        :type timesortto: int
        :param userid: The user id
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_action_events_by_timesort_serialize(
            aftereventid=aftereventid,
            limitnum=limitnum,
            limittononsuspendedevents=limittononsuspendedevents,
            searchvalue=searchvalue,
            timesortfrom=timesortfrom,
            timesortto=timesortto,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetActionEventsByTimesortResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_action_events_by_timesort_from_args(
        self,
        args
    ) -> CoreCalendarGetActionEventsByTimesortResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetActionEventsByTimesortResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_action_events_by_timesort_with_http_info(
        self,
        aftereventid: Annotated[Optional[StrictInt], Field(description="The last seen event id")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        limittononsuspendedevents: Annotated[Optional[StrictBool], Field(description="Limit the events to courses the user is not suspended in")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        timesortfrom: Annotated[Optional[StrictInt], Field(description="Time sort from")] = None,
        timesortto: Annotated[Optional[StrictInt], Field(description="Time sort to")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="The user id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCalendarGetActionEventsByTimesortResponse]:
        """Get calendar action events by tiemsort

        Get calendar action events by tiemsort

        :param aftereventid: The last seen event id
        :type aftereventid: int
        :param limitnum: Limit number
        :type limitnum: int
        :param limittononsuspendedevents: Limit the events to courses the user is not suspended in
        :type limittononsuspendedevents: bool
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param timesortfrom: Time sort from
        :type timesortfrom: int
        :param timesortto: Time sort to
        :type timesortto: int
        :param userid: The user id
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_action_events_by_timesort_serialize(
            aftereventid=aftereventid,
            limitnum=limitnum,
            limittononsuspendedevents=limittononsuspendedevents,
            searchvalue=searchvalue,
            timesortfrom=timesortfrom,
            timesortto=timesortto,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetActionEventsByTimesortResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_get_action_events_by_timesort_without_preload_content(
        self,
        aftereventid: Annotated[Optional[StrictInt], Field(description="The last seen event id")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        limittononsuspendedevents: Annotated[Optional[StrictBool], Field(description="Limit the events to courses the user is not suspended in")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        timesortfrom: Annotated[Optional[StrictInt], Field(description="Time sort from")] = None,
        timesortto: Annotated[Optional[StrictInt], Field(description="Time sort to")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="The user id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get calendar action events by tiemsort

        Get calendar action events by tiemsort

        :param aftereventid: The last seen event id
        :type aftereventid: int
        :param limitnum: Limit number
        :type limitnum: int
        :param limittononsuspendedevents: Limit the events to courses the user is not suspended in
        :type limittononsuspendedevents: bool
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param timesortfrom: Time sort from
        :type timesortfrom: int
        :param timesortto: Time sort to
        :type timesortto: int
        :param userid: The user id
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_action_events_by_timesort_serialize(
            aftereventid=aftereventid,
            limitnum=limitnum,
            limittononsuspendedevents=limittononsuspendedevents,
            searchvalue=searchvalue,
            timesortfrom=timesortfrom,
            timesortto=timesortto,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetActionEventsByTimesortResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_get_action_events_by_timesort_serialize(
        self,
        aftereventid,
        limitnum,
        limittononsuspendedevents,
        searchvalue,
        timesortfrom,
        timesortto,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_get_action_events_by_timesort'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_get_action_events_by_timesort'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_get_action_events_by_timesort',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if aftereventid is not None:
            _form_params += parse_form({'aftereventid': aftereventid})
        if limitnum is not None:
            _form_params += parse_form({'limitnum': limitnum})
        if limittononsuspendedevents is not None:
            _form_params += parse_form({'limittononsuspendedevents': limittononsuspendedevents})
        if searchvalue is not None:
            _form_params += parse_form({'searchvalue': searchvalue})
        if timesortfrom is not None:
            _form_params += parse_form({'timesortfrom': timesortfrom})
        if timesortto is not None:
            _form_params += parse_form({'timesortto': timesortto})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_get_allowed_event_types_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course to check, empty for site.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the type of events a user can create in the given course.

        Get the type of events a user can create in the given course.

        :param courseid: Course to check, empty for site.
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_allowed_event_types_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetAllowedEventTypesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_get_allowed_event_types(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course to check, empty for site.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCalendarGetAllowedEventTypesResponse:
        """Get the type of events a user can create in the given course.

        Get the type of events a user can create in the given course.

        :param courseid: Course to check, empty for site.
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_allowed_event_types_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetAllowedEventTypesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_allowed_event_types_from_args(
        self,
        args
    ) -> CoreCalendarGetAllowedEventTypesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetAllowedEventTypesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_allowed_event_types_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course to check, empty for site.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCalendarGetAllowedEventTypesResponse]:
        """Get the type of events a user can create in the given course.

        Get the type of events a user can create in the given course.

        :param courseid: Course to check, empty for site.
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_allowed_event_types_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetAllowedEventTypesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_get_allowed_event_types_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course to check, empty for site.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the type of events a user can create in the given course.

        Get the type of events a user can create in the given course.

        :param courseid: Course to check, empty for site.
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_allowed_event_types_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetAllowedEventTypesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_get_allowed_event_types_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_get_allowed_event_types'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_get_allowed_event_types'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_get_allowed_event_types',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_get_calendar_access_information_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course to check, empty for site calendar events.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Convenience function to retrieve some permissions/access information for the given course calendar.

        Convenience function to retrieve some permissions/access information for the given course calendar.

        :param courseid: Course to check, empty for site calendar events.
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_access_information_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarAccessInformationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_get_calendar_access_information(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course to check, empty for site calendar events.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCalendarGetCalendarAccessInformationResponse:
        """Convenience function to retrieve some permissions/access information for the given course calendar.

        Convenience function to retrieve some permissions/access information for the given course calendar.

        :param courseid: Course to check, empty for site calendar events.
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_access_information_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_calendar_access_information_from_args(
        self,
        args
    ) -> CoreCalendarGetCalendarAccessInformationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarAccessInformationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_calendar_access_information_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course to check, empty for site calendar events.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCalendarGetCalendarAccessInformationResponse]:
        """Convenience function to retrieve some permissions/access information for the given course calendar.

        Convenience function to retrieve some permissions/access information for the given course calendar.

        :param courseid: Course to check, empty for site calendar events.
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_access_information_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_get_calendar_access_information_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course to check, empty for site calendar events.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Convenience function to retrieve some permissions/access information for the given course calendar.

        Convenience function to retrieve some permissions/access information for the given course calendar.

        :param courseid: Course to check, empty for site calendar events.
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_access_information_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_get_calendar_access_information_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_get_calendar_access_information'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_get_calendar_access_information'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_get_calendar_access_information',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_get_calendar_day_view_args(
        self,
        day: Annotated[Optional[StrictInt], Field(description="Day to be viewed")],
        month: Annotated[Optional[StrictInt], Field(description="Month to be viewed")],
        year: Annotated[Optional[StrictInt], Field(description="Year to be viewed")],
        categoryid: Annotated[Optional[StrictInt], Field(description="Category being viewed")] = None,
        courseid: Annotated[Optional[StrictInt], Field(description="Course being viewed")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetch the day view data for a calendar

        Fetch the day view data for a calendar

        :param day: Day to be viewed (required)
        :type day: int
        :param month: Month to be viewed (required)
        :type month: int
        :param year: Year to be viewed (required)
        :type year: int
        :param categoryid: Category being viewed
        :type categoryid: int
        :param courseid: Course being viewed
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_day_view_serialize(
            day=day,
            month=month,
            year=year,
            categoryid=categoryid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarDayViewResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_get_calendar_day_view(
        self,
        day: Annotated[Optional[StrictInt], Field(description="Day to be viewed")],
        month: Annotated[Optional[StrictInt], Field(description="Month to be viewed")],
        year: Annotated[Optional[StrictInt], Field(description="Year to be viewed")],
        categoryid: Annotated[Optional[StrictInt], Field(description="Category being viewed")] = None,
        courseid: Annotated[Optional[StrictInt], Field(description="Course being viewed")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCalendarGetCalendarDayViewResponse:
        """Fetch the day view data for a calendar

        Fetch the day view data for a calendar

        :param day: Day to be viewed (required)
        :type day: int
        :param month: Month to be viewed (required)
        :type month: int
        :param year: Year to be viewed (required)
        :type year: int
        :param categoryid: Category being viewed
        :type categoryid: int
        :param courseid: Course being viewed
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_day_view_serialize(
            day=day,
            month=month,
            year=year,
            categoryid=categoryid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarDayViewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_calendar_day_view_from_args(
        self,
        args
    ) -> CoreCalendarGetCalendarDayViewResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarDayViewResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_calendar_day_view_with_http_info(
        self,
        day: Annotated[Optional[StrictInt], Field(description="Day to be viewed")],
        month: Annotated[Optional[StrictInt], Field(description="Month to be viewed")],
        year: Annotated[Optional[StrictInt], Field(description="Year to be viewed")],
        categoryid: Annotated[Optional[StrictInt], Field(description="Category being viewed")] = None,
        courseid: Annotated[Optional[StrictInt], Field(description="Course being viewed")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCalendarGetCalendarDayViewResponse]:
        """Fetch the day view data for a calendar

        Fetch the day view data for a calendar

        :param day: Day to be viewed (required)
        :type day: int
        :param month: Month to be viewed (required)
        :type month: int
        :param year: Year to be viewed (required)
        :type year: int
        :param categoryid: Category being viewed
        :type categoryid: int
        :param courseid: Course being viewed
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_day_view_serialize(
            day=day,
            month=month,
            year=year,
            categoryid=categoryid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarDayViewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_get_calendar_day_view_without_preload_content(
        self,
        day: Annotated[Optional[StrictInt], Field(description="Day to be viewed")],
        month: Annotated[Optional[StrictInt], Field(description="Month to be viewed")],
        year: Annotated[Optional[StrictInt], Field(description="Year to be viewed")],
        categoryid: Annotated[Optional[StrictInt], Field(description="Category being viewed")] = None,
        courseid: Annotated[Optional[StrictInt], Field(description="Course being viewed")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetch the day view data for a calendar

        Fetch the day view data for a calendar

        :param day: Day to be viewed (required)
        :type day: int
        :param month: Month to be viewed (required)
        :type month: int
        :param year: Year to be viewed (required)
        :type year: int
        :param categoryid: Category being viewed
        :type categoryid: int
        :param courseid: Course being viewed
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_day_view_serialize(
            day=day,
            month=month,
            year=year,
            categoryid=categoryid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarDayViewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_get_calendar_day_view_serialize(
        self,
        day,
        month,
        year,
        categoryid,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_get_calendar_day_view'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_get_calendar_day_view'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_get_calendar_day_view',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if categoryid is not None:
            _form_params += parse_form({'categoryid': categoryid})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if day is not None:
            _form_params += parse_form({'day': day})
        if month is not None:
            _form_params += parse_form({'month': month})
        if year is not None:
            _form_params += parse_form({'year': year})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_get_calendar_event_by_id_args(
        self,
        eventid: Annotated[Optional[StrictInt], Field(description="The event id to be retrieved")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get calendar event by id

        Get calendar event by id

        :param eventid: The event id to be retrieved (required)
        :type eventid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_event_by_id_serialize(
            eventid=eventid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarEventByIdResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_get_calendar_event_by_id(
        self,
        eventid: Annotated[Optional[StrictInt], Field(description="The event id to be retrieved")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCalendarGetCalendarEventByIdResponse:
        """Get calendar event by id

        Get calendar event by id

        :param eventid: The event id to be retrieved (required)
        :type eventid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_event_by_id_serialize(
            eventid=eventid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarEventByIdResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_calendar_event_by_id_from_args(
        self,
        args
    ) -> CoreCalendarGetCalendarEventByIdResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarEventByIdResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_calendar_event_by_id_with_http_info(
        self,
        eventid: Annotated[Optional[StrictInt], Field(description="The event id to be retrieved")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCalendarGetCalendarEventByIdResponse]:
        """Get calendar event by id

        Get calendar event by id

        :param eventid: The event id to be retrieved (required)
        :type eventid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_event_by_id_serialize(
            eventid=eventid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarEventByIdResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_get_calendar_event_by_id_without_preload_content(
        self,
        eventid: Annotated[Optional[StrictInt], Field(description="The event id to be retrieved")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get calendar event by id

        Get calendar event by id

        :param eventid: The event id to be retrieved (required)
        :type eventid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_event_by_id_serialize(
            eventid=eventid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarEventByIdResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_get_calendar_event_by_id_serialize(
        self,
        eventid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_get_calendar_event_by_id'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_get_calendar_event_by_id'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_get_calendar_event_by_id',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if eventid is not None:
            _form_params += parse_form({'eventid': eventid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_get_calendar_events_args(
        self,
        events: Optional[CoreCalendarGetCalendarEventsParametersEvents] = None,
        options: Optional[CoreCalendarGetCalendarEventsParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get calendar events

        Get calendar events

        :param events:
        :type events: CoreCalendarGetCalendarEventsParametersEvents
        :param options:
        :type options: CoreCalendarGetCalendarEventsParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_events_serialize(
            events=events,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarEventsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_get_calendar_events(
        self,
        events: Optional[CoreCalendarGetCalendarEventsParametersEvents] = None,
        options: Optional[CoreCalendarGetCalendarEventsParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCalendarGetCalendarEventsResponse:
        """Get calendar events

        Get calendar events

        :param events:
        :type events: CoreCalendarGetCalendarEventsParametersEvents
        :param options:
        :type options: CoreCalendarGetCalendarEventsParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_events_serialize(
            events=events,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarEventsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_calendar_events_from_args(
        self,
        args
    ) -> CoreCalendarGetCalendarEventsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarEventsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_calendar_events_with_http_info(
        self,
        events: Optional[CoreCalendarGetCalendarEventsParametersEvents] = None,
        options: Optional[CoreCalendarGetCalendarEventsParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCalendarGetCalendarEventsResponse]:
        """Get calendar events

        Get calendar events

        :param events:
        :type events: CoreCalendarGetCalendarEventsParametersEvents
        :param options:
        :type options: CoreCalendarGetCalendarEventsParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_events_serialize(
            events=events,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarEventsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_get_calendar_events_without_preload_content(
        self,
        events: Optional[CoreCalendarGetCalendarEventsParametersEvents] = None,
        options: Optional[CoreCalendarGetCalendarEventsParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get calendar events

        Get calendar events

        :param events:
        :type events: CoreCalendarGetCalendarEventsParametersEvents
        :param options:
        :type options: CoreCalendarGetCalendarEventsParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_events_serialize(
            events=events,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarEventsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_get_calendar_events_serialize(
        self,
        events,
        options,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_get_calendar_events'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_get_calendar_events'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_get_calendar_events',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if events is not None:
            _form_params += parse_form({'events': events})
        if options is not None:
            _form_params += parse_form({'options': options})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_get_calendar_export_token_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the auth token required for exporting a calendar.

        Return the auth token required for exporting a calendar.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_export_token_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarExportTokenResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_get_calendar_export_token(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCalendarGetCalendarExportTokenResponse:
        """Return the auth token required for exporting a calendar.

        Return the auth token required for exporting a calendar.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_export_token_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarExportTokenResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_calendar_export_token_from_args(
        self,
        args
    ) -> CoreCalendarGetCalendarExportTokenResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarExportTokenResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_calendar_export_token_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCalendarGetCalendarExportTokenResponse]:
        """Return the auth token required for exporting a calendar.

        Return the auth token required for exporting a calendar.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_export_token_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarExportTokenResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_get_calendar_export_token_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the auth token required for exporting a calendar.

        Return the auth token required for exporting a calendar.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_export_token_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarExportTokenResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_get_calendar_export_token_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_get_calendar_export_token'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_get_calendar_export_token'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_get_calendar_export_token',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_get_calendar_monthly_view_args(
        self,
        month: Annotated[Optional[StrictInt], Field(description="Month to be viewed")],
        year: Annotated[Optional[StrictInt], Field(description="Year to be viewed")],
        categoryid: Annotated[Optional[StrictInt], Field(description="Category being viewed")] = None,
        courseid: Annotated[Optional[StrictInt], Field(description="Course being viewed")] = None,
        day: Annotated[Optional[StrictInt], Field(description="Day to be viewed")] = None,
        includenavigation: Annotated[Optional[StrictBool], Field(description="Whether to show course navigation")] = None,
        mini: Annotated[Optional[StrictBool], Field(description="Whether to return the mini month view or not")] = None,
        view: Annotated[Optional[StrictStr], Field(description="The view mode of the calendar")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetch the monthly view data for a calendar

        Fetch the monthly view data for a calendar

        :param month: Month to be viewed (required)
        :type month: int
        :param year: Year to be viewed (required)
        :type year: int
        :param categoryid: Category being viewed
        :type categoryid: int
        :param courseid: Course being viewed
        :type courseid: int
        :param day: Day to be viewed
        :type day: int
        :param includenavigation: Whether to show course navigation
        :type includenavigation: bool
        :param mini: Whether to return the mini month view or not
        :type mini: bool
        :param view: The view mode of the calendar
        :type view: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_monthly_view_serialize(
            month=month,
            year=year,
            categoryid=categoryid,
            courseid=courseid,
            day=day,
            includenavigation=includenavigation,
            mini=mini,
            view=view,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarMonthlyViewResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_get_calendar_monthly_view(
        self,
        month: Annotated[Optional[StrictInt], Field(description="Month to be viewed")],
        year: Annotated[Optional[StrictInt], Field(description="Year to be viewed")],
        categoryid: Annotated[Optional[StrictInt], Field(description="Category being viewed")] = None,
        courseid: Annotated[Optional[StrictInt], Field(description="Course being viewed")] = None,
        day: Annotated[Optional[StrictInt], Field(description="Day to be viewed")] = None,
        includenavigation: Annotated[Optional[StrictBool], Field(description="Whether to show course navigation")] = None,
        mini: Annotated[Optional[StrictBool], Field(description="Whether to return the mini month view or not")] = None,
        view: Annotated[Optional[StrictStr], Field(description="The view mode of the calendar")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCalendarGetCalendarMonthlyViewResponse:
        """Fetch the monthly view data for a calendar

        Fetch the monthly view data for a calendar

        :param month: Month to be viewed (required)
        :type month: int
        :param year: Year to be viewed (required)
        :type year: int
        :param categoryid: Category being viewed
        :type categoryid: int
        :param courseid: Course being viewed
        :type courseid: int
        :param day: Day to be viewed
        :type day: int
        :param includenavigation: Whether to show course navigation
        :type includenavigation: bool
        :param mini: Whether to return the mini month view or not
        :type mini: bool
        :param view: The view mode of the calendar
        :type view: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_monthly_view_serialize(
            month=month,
            year=year,
            categoryid=categoryid,
            courseid=courseid,
            day=day,
            includenavigation=includenavigation,
            mini=mini,
            view=view,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarMonthlyViewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_calendar_monthly_view_from_args(
        self,
        args
    ) -> CoreCalendarGetCalendarMonthlyViewResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarMonthlyViewResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_calendar_monthly_view_with_http_info(
        self,
        month: Annotated[Optional[StrictInt], Field(description="Month to be viewed")],
        year: Annotated[Optional[StrictInt], Field(description="Year to be viewed")],
        categoryid: Annotated[Optional[StrictInt], Field(description="Category being viewed")] = None,
        courseid: Annotated[Optional[StrictInt], Field(description="Course being viewed")] = None,
        day: Annotated[Optional[StrictInt], Field(description="Day to be viewed")] = None,
        includenavigation: Annotated[Optional[StrictBool], Field(description="Whether to show course navigation")] = None,
        mini: Annotated[Optional[StrictBool], Field(description="Whether to return the mini month view or not")] = None,
        view: Annotated[Optional[StrictStr], Field(description="The view mode of the calendar")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCalendarGetCalendarMonthlyViewResponse]:
        """Fetch the monthly view data for a calendar

        Fetch the monthly view data for a calendar

        :param month: Month to be viewed (required)
        :type month: int
        :param year: Year to be viewed (required)
        :type year: int
        :param categoryid: Category being viewed
        :type categoryid: int
        :param courseid: Course being viewed
        :type courseid: int
        :param day: Day to be viewed
        :type day: int
        :param includenavigation: Whether to show course navigation
        :type includenavigation: bool
        :param mini: Whether to return the mini month view or not
        :type mini: bool
        :param view: The view mode of the calendar
        :type view: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_monthly_view_serialize(
            month=month,
            year=year,
            categoryid=categoryid,
            courseid=courseid,
            day=day,
            includenavigation=includenavigation,
            mini=mini,
            view=view,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarMonthlyViewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_get_calendar_monthly_view_without_preload_content(
        self,
        month: Annotated[Optional[StrictInt], Field(description="Month to be viewed")],
        year: Annotated[Optional[StrictInt], Field(description="Year to be viewed")],
        categoryid: Annotated[Optional[StrictInt], Field(description="Category being viewed")] = None,
        courseid: Annotated[Optional[StrictInt], Field(description="Course being viewed")] = None,
        day: Annotated[Optional[StrictInt], Field(description="Day to be viewed")] = None,
        includenavigation: Annotated[Optional[StrictBool], Field(description="Whether to show course navigation")] = None,
        mini: Annotated[Optional[StrictBool], Field(description="Whether to return the mini month view or not")] = None,
        view: Annotated[Optional[StrictStr], Field(description="The view mode of the calendar")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetch the monthly view data for a calendar

        Fetch the monthly view data for a calendar

        :param month: Month to be viewed (required)
        :type month: int
        :param year: Year to be viewed (required)
        :type year: int
        :param categoryid: Category being viewed
        :type categoryid: int
        :param courseid: Course being viewed
        :type courseid: int
        :param day: Day to be viewed
        :type day: int
        :param includenavigation: Whether to show course navigation
        :type includenavigation: bool
        :param mini: Whether to return the mini month view or not
        :type mini: bool
        :param view: The view mode of the calendar
        :type view: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_monthly_view_serialize(
            month=month,
            year=year,
            categoryid=categoryid,
            courseid=courseid,
            day=day,
            includenavigation=includenavigation,
            mini=mini,
            view=view,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarMonthlyViewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_get_calendar_monthly_view_serialize(
        self,
        month,
        year,
        categoryid,
        courseid,
        day,
        includenavigation,
        mini,
        view,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_get_calendar_monthly_view'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_get_calendar_monthly_view'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_get_calendar_monthly_view',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if categoryid is not None:
            _form_params += parse_form({'categoryid': categoryid})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if day is not None:
            _form_params += parse_form({'day': day})
        if includenavigation is not None:
            _form_params += parse_form({'includenavigation': includenavigation})
        if mini is not None:
            _form_params += parse_form({'mini': mini})
        if month is not None:
            _form_params += parse_form({'month': month})
        if view is not None:
            _form_params += parse_form({'view': view})
        if year is not None:
            _form_params += parse_form({'year': year})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_get_calendar_upcoming_view_args(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="Category being viewed")] = None,
        courseid: Annotated[Optional[StrictInt], Field(description="Course being viewed")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetch the upcoming view data for a calendar

        Fetch the upcoming view data for a calendar

        :param categoryid: Category being viewed
        :type categoryid: int
        :param courseid: Course being viewed
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_upcoming_view_serialize(
            categoryid=categoryid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarUpcomingViewResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_get_calendar_upcoming_view(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="Category being viewed")] = None,
        courseid: Annotated[Optional[StrictInt], Field(description="Course being viewed")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCalendarGetCalendarUpcomingViewResponse:
        """Fetch the upcoming view data for a calendar

        Fetch the upcoming view data for a calendar

        :param categoryid: Category being viewed
        :type categoryid: int
        :param courseid: Course being viewed
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_upcoming_view_serialize(
            categoryid=categoryid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarUpcomingViewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_calendar_upcoming_view_from_args(
        self,
        args
    ) -> CoreCalendarGetCalendarUpcomingViewResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarUpcomingViewResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_calendar_upcoming_view_with_http_info(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="Category being viewed")] = None,
        courseid: Annotated[Optional[StrictInt], Field(description="Course being viewed")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCalendarGetCalendarUpcomingViewResponse]:
        """Fetch the upcoming view data for a calendar

        Fetch the upcoming view data for a calendar

        :param categoryid: Category being viewed
        :type categoryid: int
        :param courseid: Course being viewed
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_upcoming_view_serialize(
            categoryid=categoryid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarUpcomingViewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_get_calendar_upcoming_view_without_preload_content(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="Category being viewed")] = None,
        courseid: Annotated[Optional[StrictInt], Field(description="Course being viewed")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetch the upcoming view data for a calendar

        Fetch the upcoming view data for a calendar

        :param categoryid: Category being viewed
        :type categoryid: int
        :param courseid: Course being viewed
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_calendar_upcoming_view_serialize(
            categoryid=categoryid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetCalendarUpcomingViewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_get_calendar_upcoming_view_serialize(
        self,
        categoryid,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_get_calendar_upcoming_view'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_get_calendar_upcoming_view'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_get_calendar_upcoming_view',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if categoryid is not None:
            _form_params += parse_form({'categoryid': categoryid})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_get_timestamps_args(
        self,
        data: List[CoreCalendarGetTimestampsParametersDataInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetch unix timestamps for given date times.

        Fetch unix timestamps for given date times.

        :param data: (required)
        :type data: List[CoreCalendarGetTimestampsParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_timestamps_serialize(
            data=data,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetTimestampsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_get_timestamps(
        self,
        data: List[CoreCalendarGetTimestampsParametersDataInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCalendarGetTimestampsResponse:
        """Fetch unix timestamps for given date times.

        Fetch unix timestamps for given date times.

        :param data: (required)
        :type data: List[CoreCalendarGetTimestampsParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_timestamps_serialize(
            data=data,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetTimestampsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_timestamps_from_args(
        self,
        args
    ) -> CoreCalendarGetTimestampsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetTimestampsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_get_timestamps_with_http_info(
        self,
        data: List[CoreCalendarGetTimestampsParametersDataInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCalendarGetTimestampsResponse]:
        """Fetch unix timestamps for given date times.

        Fetch unix timestamps for given date times.

        :param data: (required)
        :type data: List[CoreCalendarGetTimestampsParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_timestamps_serialize(
            data=data,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetTimestampsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_get_timestamps_without_preload_content(
        self,
        data: List[CoreCalendarGetTimestampsParametersDataInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetch unix timestamps for given date times.

        Fetch unix timestamps for given date times.

        :param data: (required)
        :type data: List[CoreCalendarGetTimestampsParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_get_timestamps_serialize(
            data=data,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarGetTimestampsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_get_timestamps_serialize(
        self,
        data,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'data': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_get_timestamps'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_get_timestamps'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_get_timestamps',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if data is not None:
            _form_params += parse_form({'data': data})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_submit_create_update_form_args(
        self,
        formdata: Annotated[Optional[StrictStr], Field(description="The data from the event form")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Submit form data for event form

        Submit form data for event form

        :param formdata: The data from the event form (required)
        :type formdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_submit_create_update_form_serialize(
            formdata=formdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarSubmitCreateUpdateFormResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_submit_create_update_form(
        self,
        formdata: Annotated[Optional[StrictStr], Field(description="The data from the event form")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCalendarSubmitCreateUpdateFormResponse:
        """Submit form data for event form

        Submit form data for event form

        :param formdata: The data from the event form (required)
        :type formdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_submit_create_update_form_serialize(
            formdata=formdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarSubmitCreateUpdateFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_submit_create_update_form_from_args(
        self,
        args
    ) -> CoreCalendarSubmitCreateUpdateFormResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarSubmitCreateUpdateFormResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_submit_create_update_form_with_http_info(
        self,
        formdata: Annotated[Optional[StrictStr], Field(description="The data from the event form")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCalendarSubmitCreateUpdateFormResponse]:
        """Submit form data for event form

        Submit form data for event form

        :param formdata: The data from the event form (required)
        :type formdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_submit_create_update_form_serialize(
            formdata=formdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarSubmitCreateUpdateFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_submit_create_update_form_without_preload_content(
        self,
        formdata: Annotated[Optional[StrictStr], Field(description="The data from the event form")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Submit form data for event form

        Submit form data for event form

        :param formdata: The data from the event form (required)
        :type formdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_submit_create_update_form_serialize(
            formdata=formdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarSubmitCreateUpdateFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_submit_create_update_form_serialize(
        self,
        formdata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_submit_create_update_form'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_submit_create_update_form'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_submit_create_update_form',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if formdata is not None:
            _form_params += parse_form({'formdata': formdata})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_calendar_update_event_start_day_args(
        self,
        daytimestamp: Annotated[Optional[StrictInt], Field(description="Timestamp for the new start day")],
        eventid: Annotated[Optional[StrictInt], Field(description="Id of event to be updated")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update the start day (but not time) for an event.

        Update the start day (but not time) for an event.

        :param daytimestamp: Timestamp for the new start day (required)
        :type daytimestamp: int
        :param eventid: Id of event to be updated (required)
        :type eventid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_update_event_start_day_serialize(
            daytimestamp=daytimestamp,
            eventid=eventid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarUpdateEventStartDayResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_calendar_update_event_start_day(
        self,
        daytimestamp: Annotated[Optional[StrictInt], Field(description="Timestamp for the new start day")],
        eventid: Annotated[Optional[StrictInt], Field(description="Id of event to be updated")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCalendarUpdateEventStartDayResponse:
        """Update the start day (but not time) for an event.

        Update the start day (but not time) for an event.

        :param daytimestamp: Timestamp for the new start day (required)
        :type daytimestamp: int
        :param eventid: Id of event to be updated (required)
        :type eventid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_update_event_start_day_serialize(
            daytimestamp=daytimestamp,
            eventid=eventid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarUpdateEventStartDayResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_update_event_start_day_from_args(
        self,
        args
    ) -> CoreCalendarUpdateEventStartDayResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarUpdateEventStartDayResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_calendar_update_event_start_day_with_http_info(
        self,
        daytimestamp: Annotated[Optional[StrictInt], Field(description="Timestamp for the new start day")],
        eventid: Annotated[Optional[StrictInt], Field(description="Id of event to be updated")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCalendarUpdateEventStartDayResponse]:
        """Update the start day (but not time) for an event.

        Update the start day (but not time) for an event.

        :param daytimestamp: Timestamp for the new start day (required)
        :type daytimestamp: int
        :param eventid: Id of event to be updated (required)
        :type eventid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_update_event_start_day_serialize(
            daytimestamp=daytimestamp,
            eventid=eventid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarUpdateEventStartDayResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_calendar_update_event_start_day_without_preload_content(
        self,
        daytimestamp: Annotated[Optional[StrictInt], Field(description="Timestamp for the new start day")],
        eventid: Annotated[Optional[StrictInt], Field(description="Id of event to be updated")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update the start day (but not time) for an event.

        Update the start day (but not time) for an event.

        :param daytimestamp: Timestamp for the new start day (required)
        :type daytimestamp: int
        :param eventid: Id of event to be updated (required)
        :type eventid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_calendar_update_event_start_day_serialize(
            daytimestamp=daytimestamp,
            eventid=eventid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCalendarUpdateEventStartDayResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_calendar_update_event_start_day_serialize(
        self,
        daytimestamp,
        eventid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_calendar_update_event_start_day'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_calendar_update_event_start_day'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_calendar_update_event_start_day',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if daytimestamp is not None:
            _form_params += parse_form({'daytimestamp': daytimestamp})
        if eventid is not None:
            _form_params += parse_form({'eventid': eventid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_change_editmode_args(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Page context id")],
        setmode: Annotated[Optional[StrictBool], Field(description="Set edit mode to")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Change the editing mode

        Change the editing mode

        :param context: Page context id (required)
        :type context: int
        :param setmode: Set edit mode to (required)
        :type setmode: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_change_editmode_serialize(
            context=context,
            setmode=setmode,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreChangeEditmodeResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_change_editmode(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Page context id")],
        setmode: Annotated[Optional[StrictBool], Field(description="Set edit mode to")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreChangeEditmodeResponse:
        """Change the editing mode

        Change the editing mode

        :param context: Page context id (required)
        :type context: int
        :param setmode: Set edit mode to (required)
        :type setmode: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_change_editmode_serialize(
            context=context,
            setmode=setmode,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreChangeEditmodeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_change_editmode_from_args(
        self,
        args
    ) -> CoreChangeEditmodeResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreChangeEditmodeResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_change_editmode_with_http_info(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Page context id")],
        setmode: Annotated[Optional[StrictBool], Field(description="Set edit mode to")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreChangeEditmodeResponse]:
        """Change the editing mode

        Change the editing mode

        :param context: Page context id (required)
        :type context: int
        :param setmode: Set edit mode to (required)
        :type setmode: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_change_editmode_serialize(
            context=context,
            setmode=setmode,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreChangeEditmodeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_change_editmode_without_preload_content(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Page context id")],
        setmode: Annotated[Optional[StrictBool], Field(description="Set edit mode to")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Change the editing mode

        Change the editing mode

        :param context: Page context id (required)
        :type context: int
        :param setmode: Set edit mode to (required)
        :type setmode: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_change_editmode_serialize(
            context=context,
            setmode=setmode,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreChangeEditmodeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_change_editmode_serialize(
        self,
        context,
        setmode,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_change_editmode'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_change_editmode'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_change_editmode',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if context is not None:
            _form_params += parse_form({'context': context})
        if setmode is not None:
            _form_params += parse_form({'setmode': setmode})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_check_get_result_admintree_args(
        self,
        admintreeid: Annotated[Optional[StrictStr], Field(description="ID of node in admintree")],
        settingname: Annotated[Optional[StrictStr], Field(description="Name of setting")],
        includedetails: Annotated[Optional[StrictBool], Field(description="If the details should be included in the response.                 Depending on the check, details could be slower to return.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Executes a check stored in the admin tree and returns the result

        Executes a check stored in the admin tree and returns the result

        :param admintreeid: ID of node in admintree (required)
        :type admintreeid: str
        :param settingname: Name of setting (required)
        :type settingname: str
        :param includedetails: If the details should be included in the response.                 Depending on the check, details could be slower to return.
        :type includedetails: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_check_get_result_admintree_serialize(
            admintreeid=admintreeid,
            settingname=settingname,
            includedetails=includedetails,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCheckGetResultAdmintreeResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_check_get_result_admintree(
        self,
        admintreeid: Annotated[Optional[StrictStr], Field(description="ID of node in admintree")],
        settingname: Annotated[Optional[StrictStr], Field(description="Name of setting")],
        includedetails: Annotated[Optional[StrictBool], Field(description="If the details should be included in the response.                 Depending on the check, details could be slower to return.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCheckGetResultAdmintreeResponse:
        """Executes a check stored in the admin tree and returns the result

        Executes a check stored in the admin tree and returns the result

        :param admintreeid: ID of node in admintree (required)
        :type admintreeid: str
        :param settingname: Name of setting (required)
        :type settingname: str
        :param includedetails: If the details should be included in the response.                 Depending on the check, details could be slower to return.
        :type includedetails: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_check_get_result_admintree_serialize(
            admintreeid=admintreeid,
            settingname=settingname,
            includedetails=includedetails,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCheckGetResultAdmintreeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_check_get_result_admintree_from_args(
        self,
        args
    ) -> CoreCheckGetResultAdmintreeResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCheckGetResultAdmintreeResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_check_get_result_admintree_with_http_info(
        self,
        admintreeid: Annotated[Optional[StrictStr], Field(description="ID of node in admintree")],
        settingname: Annotated[Optional[StrictStr], Field(description="Name of setting")],
        includedetails: Annotated[Optional[StrictBool], Field(description="If the details should be included in the response.                 Depending on the check, details could be slower to return.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCheckGetResultAdmintreeResponse]:
        """Executes a check stored in the admin tree and returns the result

        Executes a check stored in the admin tree and returns the result

        :param admintreeid: ID of node in admintree (required)
        :type admintreeid: str
        :param settingname: Name of setting (required)
        :type settingname: str
        :param includedetails: If the details should be included in the response.                 Depending on the check, details could be slower to return.
        :type includedetails: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_check_get_result_admintree_serialize(
            admintreeid=admintreeid,
            settingname=settingname,
            includedetails=includedetails,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCheckGetResultAdmintreeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_check_get_result_admintree_without_preload_content(
        self,
        admintreeid: Annotated[Optional[StrictStr], Field(description="ID of node in admintree")],
        settingname: Annotated[Optional[StrictStr], Field(description="Name of setting")],
        includedetails: Annotated[Optional[StrictBool], Field(description="If the details should be included in the response.                 Depending on the check, details could be slower to return.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Executes a check stored in the admin tree and returns the result

        Executes a check stored in the admin tree and returns the result

        :param admintreeid: ID of node in admintree (required)
        :type admintreeid: str
        :param settingname: Name of setting (required)
        :type settingname: str
        :param includedetails: If the details should be included in the response.                 Depending on the check, details could be slower to return.
        :type includedetails: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_check_get_result_admintree_serialize(
            admintreeid=admintreeid,
            settingname=settingname,
            includedetails=includedetails,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCheckGetResultAdmintreeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_check_get_result_admintree_serialize(
        self,
        admintreeid,
        settingname,
        includedetails,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_check_get_result_admintree'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_check_get_result_admintree'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_check_get_result_admintree',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if admintreeid is not None:
            _form_params += parse_form({'admintreeid': admintreeid})
        if includedetails is not None:
            _form_params += parse_form({'includedetails': includedetails})
        if settingname is not None:
            _form_params += parse_form({'settingname': settingname})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_cohort_add_cohort_members_args(
        self,
        members: List[CoreCohortAddCohortMembersParametersMembersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Adds cohort members.

        Adds cohort members.

        :param members: (required)
        :type members: List[CoreCohortAddCohortMembersParametersMembersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_add_cohort_members_serialize(
            members=members,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCohortAddCohortMembersResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_cohort_add_cohort_members(
        self,
        members: List[CoreCohortAddCohortMembersParametersMembersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCohortAddCohortMembersResponse:
        """Adds cohort members.

        Adds cohort members.

        :param members: (required)
        :type members: List[CoreCohortAddCohortMembersParametersMembersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_add_cohort_members_serialize(
            members=members,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCohortAddCohortMembersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_cohort_add_cohort_members_from_args(
        self,
        args
    ) -> CoreCohortAddCohortMembersResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCohortAddCohortMembersResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_cohort_add_cohort_members_with_http_info(
        self,
        members: List[CoreCohortAddCohortMembersParametersMembersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCohortAddCohortMembersResponse]:
        """Adds cohort members.

        Adds cohort members.

        :param members: (required)
        :type members: List[CoreCohortAddCohortMembersParametersMembersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_add_cohort_members_serialize(
            members=members,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCohortAddCohortMembersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_cohort_add_cohort_members_without_preload_content(
        self,
        members: List[CoreCohortAddCohortMembersParametersMembersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Adds cohort members.

        Adds cohort members.

        :param members: (required)
        :type members: List[CoreCohortAddCohortMembersParametersMembersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_add_cohort_members_serialize(
            members=members,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCohortAddCohortMembersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_cohort_add_cohort_members_serialize(
        self,
        members,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'members': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_cohort_add_cohort_members'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_cohort_add_cohort_members'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_cohort_add_cohort_members',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if members is not None:
            _form_params += parse_form({'members': members})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_cohort_create_cohorts_args(
        self,
        cohorts: List[CoreCohortCreateCohortsParametersCohortsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Creates new cohorts.

        Creates new cohorts.

        :param cohorts: (required)
        :type cohorts: List[CoreCohortCreateCohortsParametersCohortsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_create_cohorts_serialize(
            cohorts=cohorts,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCohortCreateCohortsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_cohort_create_cohorts(
        self,
        cohorts: List[CoreCohortCreateCohortsParametersCohortsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCohortCreateCohortsResponseInner]:
        """Creates new cohorts.

        Creates new cohorts.

        :param cohorts: (required)
        :type cohorts: List[CoreCohortCreateCohortsParametersCohortsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_create_cohorts_serialize(
            cohorts=cohorts,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCohortCreateCohortsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_cohort_create_cohorts_from_args(
        self,
        args
    ) -> List[CoreCohortCreateCohortsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCohortCreateCohortsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_cohort_create_cohorts_with_http_info(
        self,
        cohorts: List[CoreCohortCreateCohortsParametersCohortsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCohortCreateCohortsResponseInner]]:
        """Creates new cohorts.

        Creates new cohorts.

        :param cohorts: (required)
        :type cohorts: List[CoreCohortCreateCohortsParametersCohortsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_create_cohorts_serialize(
            cohorts=cohorts,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCohortCreateCohortsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_cohort_create_cohorts_without_preload_content(
        self,
        cohorts: List[CoreCohortCreateCohortsParametersCohortsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Creates new cohorts.

        Creates new cohorts.

        :param cohorts: (required)
        :type cohorts: List[CoreCohortCreateCohortsParametersCohortsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_create_cohorts_serialize(
            cohorts=cohorts,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCohortCreateCohortsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_cohort_create_cohorts_serialize(
        self,
        cohorts,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'cohorts': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_cohort_create_cohorts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_cohort_create_cohorts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_cohort_create_cohorts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cohorts is not None:
            _form_params += parse_form({'cohorts': cohorts})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_cohort_delete_cohort_members_args(
        self,
        members: List[CoreCohortDeleteCohortMembersParametersMembersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes cohort members.

        Deletes cohort members.

        :param members: (required)
        :type members: List[CoreCohortDeleteCohortMembersParametersMembersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_delete_cohort_members_serialize(
            members=members,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_cohort_delete_cohort_members(
        self,
        members: List[CoreCohortDeleteCohortMembersParametersMembersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Deletes cohort members.

        Deletes cohort members.

        :param members: (required)
        :type members: List[CoreCohortDeleteCohortMembersParametersMembersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_delete_cohort_members_serialize(
            members=members,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_cohort_delete_cohort_members_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_cohort_delete_cohort_members_with_http_info(
        self,
        members: List[CoreCohortDeleteCohortMembersParametersMembersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Deletes cohort members.

        Deletes cohort members.

        :param members: (required)
        :type members: List[CoreCohortDeleteCohortMembersParametersMembersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_delete_cohort_members_serialize(
            members=members,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_cohort_delete_cohort_members_without_preload_content(
        self,
        members: List[CoreCohortDeleteCohortMembersParametersMembersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes cohort members.

        Deletes cohort members.

        :param members: (required)
        :type members: List[CoreCohortDeleteCohortMembersParametersMembersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_delete_cohort_members_serialize(
            members=members,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_cohort_delete_cohort_members_serialize(
        self,
        members,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'members': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_cohort_delete_cohort_members'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_cohort_delete_cohort_members'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_cohort_delete_cohort_members',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if members is not None:
            _form_params += parse_form({'members': members})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_cohort_delete_cohorts_args(
        self,
        cohortids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes all specified cohorts.

        Deletes all specified cohorts.

        :param cohortids: (required)
        :type cohortids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_delete_cohorts_serialize(
            cohortids=cohortids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_cohort_delete_cohorts(
        self,
        cohortids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Deletes all specified cohorts.

        Deletes all specified cohorts.

        :param cohortids: (required)
        :type cohortids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_delete_cohorts_serialize(
            cohortids=cohortids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_cohort_delete_cohorts_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_cohort_delete_cohorts_with_http_info(
        self,
        cohortids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Deletes all specified cohorts.

        Deletes all specified cohorts.

        :param cohortids: (required)
        :type cohortids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_delete_cohorts_serialize(
            cohortids=cohortids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_cohort_delete_cohorts_without_preload_content(
        self,
        cohortids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes all specified cohorts.

        Deletes all specified cohorts.

        :param cohortids: (required)
        :type cohortids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_delete_cohorts_serialize(
            cohortids=cohortids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_cohort_delete_cohorts_serialize(
        self,
        cohortids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'cohortids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_cohort_delete_cohorts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_cohort_delete_cohorts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_cohort_delete_cohorts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cohortids is not None:
            _form_params += parse_form({'cohortids': cohortids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_cohort_get_cohort_members_args(
        self,
        cohortids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns cohort members.

        Returns cohort members.

        :param cohortids: (required)
        :type cohortids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_get_cohort_members_serialize(
            cohortids=cohortids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCohortGetCohortMembersResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_cohort_get_cohort_members(
        self,
        cohortids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCohortGetCohortMembersResponseInner]:
        """Returns cohort members.

        Returns cohort members.

        :param cohortids: (required)
        :type cohortids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_get_cohort_members_serialize(
            cohortids=cohortids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCohortGetCohortMembersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_cohort_get_cohort_members_from_args(
        self,
        args
    ) -> List[CoreCohortGetCohortMembersResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCohortGetCohortMembersResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_cohort_get_cohort_members_with_http_info(
        self,
        cohortids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCohortGetCohortMembersResponseInner]]:
        """Returns cohort members.

        Returns cohort members.

        :param cohortids: (required)
        :type cohortids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_get_cohort_members_serialize(
            cohortids=cohortids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCohortGetCohortMembersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_cohort_get_cohort_members_without_preload_content(
        self,
        cohortids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns cohort members.

        Returns cohort members.

        :param cohortids: (required)
        :type cohortids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_get_cohort_members_serialize(
            cohortids=cohortids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCohortGetCohortMembersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_cohort_get_cohort_members_serialize(
        self,
        cohortids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'cohortids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_cohort_get_cohort_members'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_cohort_get_cohort_members'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_cohort_get_cohort_members',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cohortids is not None:
            _form_params += parse_form({'cohortids': cohortids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_cohort_get_cohorts_args(
        self,
        cohortids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="List of cohort id. A cohort id is an integer.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns cohort details.

        Returns cohort details.

        :param cohortids: List of cohort id. A cohort id is an integer.
        :type cohortids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_get_cohorts_serialize(
            cohortids=cohortids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCohortGetCohortsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_cohort_get_cohorts(
        self,
        cohortids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="List of cohort id. A cohort id is an integer.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCohortGetCohortsResponseInner]:
        """Returns cohort details.

        Returns cohort details.

        :param cohortids: List of cohort id. A cohort id is an integer.
        :type cohortids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_get_cohorts_serialize(
            cohortids=cohortids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCohortGetCohortsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_cohort_get_cohorts_from_args(
        self,
        args
    ) -> List[CoreCohortGetCohortsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCohortGetCohortsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_cohort_get_cohorts_with_http_info(
        self,
        cohortids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="List of cohort id. A cohort id is an integer.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCohortGetCohortsResponseInner]]:
        """Returns cohort details.

        Returns cohort details.

        :param cohortids: List of cohort id. A cohort id is an integer.
        :type cohortids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_get_cohorts_serialize(
            cohortids=cohortids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCohortGetCohortsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_cohort_get_cohorts_without_preload_content(
        self,
        cohortids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="List of cohort id. A cohort id is an integer.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns cohort details.

        Returns cohort details.

        :param cohortids: List of cohort id. A cohort id is an integer.
        :type cohortids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_get_cohorts_serialize(
            cohortids=cohortids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCohortGetCohortsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_cohort_get_cohorts_serialize(
        self,
        cohortids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'cohortids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_cohort_get_cohorts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_cohort_get_cohorts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_cohort_get_cohorts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cohortids is not None:
            _form_params += parse_form({'cohortids': cohortids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_cohort_search_cohorts_args(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        query: Annotated[Optional[StrictStr], Field(description="Query string")],
        includes: Annotated[Optional[StrictStr], Field(description="What other contexts to fetch the frameworks from. (all, parents, self)")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="limitfrom we are fetching the records from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Number of records to fetch")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Search for cohorts.

        Search for cohorts.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param query: Query string (required)
        :type query: str
        :param includes: What other contexts to fetch the frameworks from. (all, parents, self)
        :type includes: str
        :param limitfrom: limitfrom we are fetching the records from
        :type limitfrom: int
        :param limitnum: Number of records to fetch
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_search_cohorts_serialize(
            context=context,
            query=query,
            includes=includes,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCohortSearchCohortsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_cohort_search_cohorts(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        query: Annotated[Optional[StrictStr], Field(description="Query string")],
        includes: Annotated[Optional[StrictStr], Field(description="What other contexts to fetch the frameworks from. (all, parents, self)")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="limitfrom we are fetching the records from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Number of records to fetch")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCohortSearchCohortsResponse:
        """Search for cohorts.

        Search for cohorts.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param query: Query string (required)
        :type query: str
        :param includes: What other contexts to fetch the frameworks from. (all, parents, self)
        :type includes: str
        :param limitfrom: limitfrom we are fetching the records from
        :type limitfrom: int
        :param limitnum: Number of records to fetch
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_search_cohorts_serialize(
            context=context,
            query=query,
            includes=includes,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCohortSearchCohortsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_cohort_search_cohorts_from_args(
        self,
        args
    ) -> CoreCohortSearchCohortsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCohortSearchCohortsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_cohort_search_cohorts_with_http_info(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        query: Annotated[Optional[StrictStr], Field(description="Query string")],
        includes: Annotated[Optional[StrictStr], Field(description="What other contexts to fetch the frameworks from. (all, parents, self)")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="limitfrom we are fetching the records from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Number of records to fetch")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCohortSearchCohortsResponse]:
        """Search for cohorts.

        Search for cohorts.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param query: Query string (required)
        :type query: str
        :param includes: What other contexts to fetch the frameworks from. (all, parents, self)
        :type includes: str
        :param limitfrom: limitfrom we are fetching the records from
        :type limitfrom: int
        :param limitnum: Number of records to fetch
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_search_cohorts_serialize(
            context=context,
            query=query,
            includes=includes,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCohortSearchCohortsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_cohort_search_cohorts_without_preload_content(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        query: Annotated[Optional[StrictStr], Field(description="Query string")],
        includes: Annotated[Optional[StrictStr], Field(description="What other contexts to fetch the frameworks from. (all, parents, self)")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="limitfrom we are fetching the records from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Number of records to fetch")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Search for cohorts.

        Search for cohorts.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param query: Query string (required)
        :type query: str
        :param includes: What other contexts to fetch the frameworks from. (all, parents, self)
        :type includes: str
        :param limitfrom: limitfrom we are fetching the records from
        :type limitfrom: int
        :param limitnum: Number of records to fetch
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_search_cohorts_serialize(
            context=context,
            query=query,
            includes=includes,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCohortSearchCohortsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_cohort_search_cohorts_serialize(
        self,
        context,
        query,
        includes,
        limitfrom,
        limitnum,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_cohort_search_cohorts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_cohort_search_cohorts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_cohort_search_cohorts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if context is not None:
            _form_params += parse_form({'context': context})
        if includes is not None:
            _form_params += parse_form({'includes': includes})
        if limitfrom is not None:
            _form_params += parse_form({'limitfrom': limitfrom})
        if limitnum is not None:
            _form_params += parse_form({'limitnum': limitnum})
        if query is not None:
            _form_params += parse_form({'query': query})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_cohort_update_cohorts_args(
        self,
        cohorts: List[CoreCohortUpdateCohortsParametersCohortsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Updates existing cohorts.

        Updates existing cohorts.

        :param cohorts: (required)
        :type cohorts: List[CoreCohortUpdateCohortsParametersCohortsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_update_cohorts_serialize(
            cohorts=cohorts,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_cohort_update_cohorts(
        self,
        cohorts: List[CoreCohortUpdateCohortsParametersCohortsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Updates existing cohorts.

        Updates existing cohorts.

        :param cohorts: (required)
        :type cohorts: List[CoreCohortUpdateCohortsParametersCohortsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_update_cohorts_serialize(
            cohorts=cohorts,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_cohort_update_cohorts_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_cohort_update_cohorts_with_http_info(
        self,
        cohorts: List[CoreCohortUpdateCohortsParametersCohortsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Updates existing cohorts.

        Updates existing cohorts.

        :param cohorts: (required)
        :type cohorts: List[CoreCohortUpdateCohortsParametersCohortsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_update_cohorts_serialize(
            cohorts=cohorts,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_cohort_update_cohorts_without_preload_content(
        self,
        cohorts: List[CoreCohortUpdateCohortsParametersCohortsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Updates existing cohorts.

        Updates existing cohorts.

        :param cohorts: (required)
        :type cohorts: List[CoreCohortUpdateCohortsParametersCohortsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_cohort_update_cohorts_serialize(
            cohorts=cohorts,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_cohort_update_cohorts_serialize(
        self,
        cohorts,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'cohorts': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_cohort_update_cohorts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_cohort_update_cohorts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_cohort_update_cohorts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cohorts is not None:
            _form_params += parse_form({'cohorts': cohorts})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_comment_add_comments_args(
        self,
        comments: List[CoreCommentAddCommentsParametersCommentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Adds a comment or comments.

        Adds a comment or comments.

        :param comments: (required)
        :type comments: List[CoreCommentAddCommentsParametersCommentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_comment_add_comments_serialize(
            comments=comments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCommentAddCommentsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_comment_add_comments(
        self,
        comments: List[CoreCommentAddCommentsParametersCommentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCommentAddCommentsResponseInner]:
        """Adds a comment or comments.

        Adds a comment or comments.

        :param comments: (required)
        :type comments: List[CoreCommentAddCommentsParametersCommentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_comment_add_comments_serialize(
            comments=comments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCommentAddCommentsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_comment_add_comments_from_args(
        self,
        args
    ) -> List[CoreCommentAddCommentsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCommentAddCommentsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_comment_add_comments_with_http_info(
        self,
        comments: List[CoreCommentAddCommentsParametersCommentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCommentAddCommentsResponseInner]]:
        """Adds a comment or comments.

        Adds a comment or comments.

        :param comments: (required)
        :type comments: List[CoreCommentAddCommentsParametersCommentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_comment_add_comments_serialize(
            comments=comments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCommentAddCommentsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_comment_add_comments_without_preload_content(
        self,
        comments: List[CoreCommentAddCommentsParametersCommentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Adds a comment or comments.

        Adds a comment or comments.

        :param comments: (required)
        :type comments: List[CoreCommentAddCommentsParametersCommentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_comment_add_comments_serialize(
            comments=comments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCommentAddCommentsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_comment_add_comments_serialize(
        self,
        comments,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'comments': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_comment_add_comments'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_comment_add_comments'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_comment_add_comments',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if comments is not None:
            _form_params += parse_form({'comments': comments})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_comment_delete_comments_args(
        self,
        comments: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes a comment or comments.

        Deletes a comment or comments.

        :param comments: (required)
        :type comments: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_comment_delete_comments_serialize(
            comments=comments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_comment_delete_comments(
        self,
        comments: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Deletes a comment or comments.

        Deletes a comment or comments.

        :param comments: (required)
        :type comments: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_comment_delete_comments_serialize(
            comments=comments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_comment_delete_comments_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_comment_delete_comments_with_http_info(
        self,
        comments: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Deletes a comment or comments.

        Deletes a comment or comments.

        :param comments: (required)
        :type comments: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_comment_delete_comments_serialize(
            comments=comments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_comment_delete_comments_without_preload_content(
        self,
        comments: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes a comment or comments.

        Deletes a comment or comments.

        :param comments: (required)
        :type comments: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_comment_delete_comments_serialize(
            comments=comments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_comment_delete_comments_serialize(
        self,
        comments,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'comments': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_comment_delete_comments'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_comment_delete_comments'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_comment_delete_comments',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if comments is not None:
            _form_params += parse_form({'comments': comments})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_comment_get_comments_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        contextlevel: Annotated[Optional[StrictStr], Field(description="contextlevel system, course, user...")],
        instanceid: Annotated[Optional[StrictInt], Field(description="the Instance id of item associated with the context level")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        area: Annotated[Optional[StrictStr], Field(description="string comment area")] = None,
        page: Annotated[Optional[StrictInt], Field(description="page number (0 based)")] = None,
        sortdirection: Annotated[Optional[StrictStr], Field(description="Sort direction: ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns comments.

        Returns comments.

        :param component: component (required)
        :type component: str
        :param contextlevel: contextlevel system, course, user... (required)
        :type contextlevel: str
        :param instanceid: the Instance id of item associated with the context level (required)
        :type instanceid: int
        :param itemid: associated id (required)
        :type itemid: int
        :param area: string comment area
        :type area: str
        :param page: page number (0 based)
        :type page: int
        :param sortdirection: Sort direction: ASC or DESC
        :type sortdirection: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_comment_get_comments_serialize(
            component=component,
            contextlevel=contextlevel,
            instanceid=instanceid,
            itemid=itemid,
            area=area,
            page=page,
            sortdirection=sortdirection,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCommentGetCommentsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_comment_get_comments(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        contextlevel: Annotated[Optional[StrictStr], Field(description="contextlevel system, course, user...")],
        instanceid: Annotated[Optional[StrictInt], Field(description="the Instance id of item associated with the context level")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        area: Annotated[Optional[StrictStr], Field(description="string comment area")] = None,
        page: Annotated[Optional[StrictInt], Field(description="page number (0 based)")] = None,
        sortdirection: Annotated[Optional[StrictStr], Field(description="Sort direction: ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCommentGetCommentsResponse:
        """Returns comments.

        Returns comments.

        :param component: component (required)
        :type component: str
        :param contextlevel: contextlevel system, course, user... (required)
        :type contextlevel: str
        :param instanceid: the Instance id of item associated with the context level (required)
        :type instanceid: int
        :param itemid: associated id (required)
        :type itemid: int
        :param area: string comment area
        :type area: str
        :param page: page number (0 based)
        :type page: int
        :param sortdirection: Sort direction: ASC or DESC
        :type sortdirection: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_comment_get_comments_serialize(
            component=component,
            contextlevel=contextlevel,
            instanceid=instanceid,
            itemid=itemid,
            area=area,
            page=page,
            sortdirection=sortdirection,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCommentGetCommentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_comment_get_comments_from_args(
        self,
        args
    ) -> CoreCommentGetCommentsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCommentGetCommentsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_comment_get_comments_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        contextlevel: Annotated[Optional[StrictStr], Field(description="contextlevel system, course, user...")],
        instanceid: Annotated[Optional[StrictInt], Field(description="the Instance id of item associated with the context level")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        area: Annotated[Optional[StrictStr], Field(description="string comment area")] = None,
        page: Annotated[Optional[StrictInt], Field(description="page number (0 based)")] = None,
        sortdirection: Annotated[Optional[StrictStr], Field(description="Sort direction: ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCommentGetCommentsResponse]:
        """Returns comments.

        Returns comments.

        :param component: component (required)
        :type component: str
        :param contextlevel: contextlevel system, course, user... (required)
        :type contextlevel: str
        :param instanceid: the Instance id of item associated with the context level (required)
        :type instanceid: int
        :param itemid: associated id (required)
        :type itemid: int
        :param area: string comment area
        :type area: str
        :param page: page number (0 based)
        :type page: int
        :param sortdirection: Sort direction: ASC or DESC
        :type sortdirection: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_comment_get_comments_serialize(
            component=component,
            contextlevel=contextlevel,
            instanceid=instanceid,
            itemid=itemid,
            area=area,
            page=page,
            sortdirection=sortdirection,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCommentGetCommentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_comment_get_comments_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        contextlevel: Annotated[Optional[StrictStr], Field(description="contextlevel system, course, user...")],
        instanceid: Annotated[Optional[StrictInt], Field(description="the Instance id of item associated with the context level")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        area: Annotated[Optional[StrictStr], Field(description="string comment area")] = None,
        page: Annotated[Optional[StrictInt], Field(description="page number (0 based)")] = None,
        sortdirection: Annotated[Optional[StrictStr], Field(description="Sort direction: ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns comments.

        Returns comments.

        :param component: component (required)
        :type component: str
        :param contextlevel: contextlevel system, course, user... (required)
        :type contextlevel: str
        :param instanceid: the Instance id of item associated with the context level (required)
        :type instanceid: int
        :param itemid: associated id (required)
        :type itemid: int
        :param area: string comment area
        :type area: str
        :param page: page number (0 based)
        :type page: int
        :param sortdirection: Sort direction: ASC or DESC
        :type sortdirection: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_comment_get_comments_serialize(
            component=component,
            contextlevel=contextlevel,
            instanceid=instanceid,
            itemid=itemid,
            area=area,
            page=page,
            sortdirection=sortdirection,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCommentGetCommentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_comment_get_comments_serialize(
        self,
        component,
        contextlevel,
        instanceid,
        itemid,
        area,
        page,
        sortdirection,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_comment_get_comments'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_comment_get_comments'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_comment_get_comments',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if area is not None:
            _form_params += parse_form({'area': area})
        if component is not None:
            _form_params += parse_form({'component': component})
        if contextlevel is not None:
            _form_params += parse_form({'contextlevel': contextlevel})
        if instanceid is not None:
            _form_params += parse_form({'instanceid': instanceid})
        if itemid is not None:
            _form_params += parse_form({'itemid': itemid})
        if page is not None:
            _form_params += parse_form({'page': page})
        if sortdirection is not None:
            _form_params += parse_form({'sortdirection': sortdirection})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_add_competency_to_course_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Add the competency to a course

        Add the competency to a course

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param courseid: The course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_add_competency_to_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_add_competency_to_course(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Add the competency to a course

        Add the competency to a course

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param courseid: The course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_add_competency_to_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_add_competency_to_course_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_add_competency_to_course_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Add the competency to a course

        Add the competency to a course

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param courseid: The course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_add_competency_to_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_add_competency_to_course_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Add the competency to a course

        Add the competency to a course

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param courseid: The course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_add_competency_to_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_add_competency_to_course_serialize(
        self,
        competencyid,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_add_competency_to_course'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_add_competency_to_course'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_add_competency_to_course',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_add_competency_to_plan_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Add the competency to a learning plan

        Add the competency to a learning plan

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_add_competency_to_plan_serialize(
            competencyid=competencyid,
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_add_competency_to_plan(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Add the competency to a learning plan

        Add the competency to a learning plan

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_add_competency_to_plan_serialize(
            competencyid=competencyid,
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_add_competency_to_plan_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_add_competency_to_plan_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Add the competency to a learning plan

        Add the competency to a learning plan

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_add_competency_to_plan_serialize(
            competencyid=competencyid,
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_add_competency_to_plan_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Add the competency to a learning plan

        Add the competency to a learning plan

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_add_competency_to_plan_serialize(
            competencyid=competencyid,
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_add_competency_to_plan_serialize(
        self,
        competencyid,
        planid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_add_competency_to_plan'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_add_competency_to_plan'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_add_competency_to_plan',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if planid is not None:
            _form_params += parse_form({'planid': planid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_add_competency_to_template_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        templateid: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Add the competency to a template

        Add the competency to a template

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param templateid: The template id (required)
        :type templateid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_add_competency_to_template_serialize(
            competencyid=competencyid,
            templateid=templateid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_add_competency_to_template(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        templateid: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Add the competency to a template

        Add the competency to a template

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param templateid: The template id (required)
        :type templateid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_add_competency_to_template_serialize(
            competencyid=competencyid,
            templateid=templateid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_add_competency_to_template_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_add_competency_to_template_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        templateid: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Add the competency to a template

        Add the competency to a template

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param templateid: The template id (required)
        :type templateid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_add_competency_to_template_serialize(
            competencyid=competencyid,
            templateid=templateid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_add_competency_to_template_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        templateid: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Add the competency to a template

        Add the competency to a template

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param templateid: The template id (required)
        :type templateid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_add_competency_to_template_serialize(
            competencyid=competencyid,
            templateid=templateid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_add_competency_to_template_serialize(
        self,
        competencyid,
        templateid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_add_competency_to_template'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_add_competency_to_template'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_add_competency_to_template',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if templateid is not None:
            _form_params += parse_form({'templateid': templateid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_add_related_competency_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        relatedcompetencyid: Annotated[Optional[StrictInt], Field(description="The related competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Adds a related competency

        Adds a related competency

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param relatedcompetencyid: The related competency id (required)
        :type relatedcompetencyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_add_related_competency_serialize(
            competencyid=competencyid,
            relatedcompetencyid=relatedcompetencyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_add_related_competency(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        relatedcompetencyid: Annotated[Optional[StrictInt], Field(description="The related competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Adds a related competency

        Adds a related competency

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param relatedcompetencyid: The related competency id (required)
        :type relatedcompetencyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_add_related_competency_serialize(
            competencyid=competencyid,
            relatedcompetencyid=relatedcompetencyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_add_related_competency_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_add_related_competency_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        relatedcompetencyid: Annotated[Optional[StrictInt], Field(description="The related competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Adds a related competency

        Adds a related competency

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param relatedcompetencyid: The related competency id (required)
        :type relatedcompetencyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_add_related_competency_serialize(
            competencyid=competencyid,
            relatedcompetencyid=relatedcompetencyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_add_related_competency_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        relatedcompetencyid: Annotated[Optional[StrictInt], Field(description="The related competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Adds a related competency

        Adds a related competency

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param relatedcompetencyid: The related competency id (required)
        :type relatedcompetencyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_add_related_competency_serialize(
            competencyid=competencyid,
            relatedcompetencyid=relatedcompetencyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_add_related_competency_serialize(
        self,
        competencyid,
        relatedcompetencyid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_add_related_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_add_related_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_add_related_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if relatedcompetencyid is not None:
            _form_params += parse_form({'relatedcompetencyid': relatedcompetencyid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_approve_plan_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Approve a plan.

        Approve a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_approve_plan_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_approve_plan(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Approve a plan.

        Approve a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_approve_plan_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_approve_plan_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_approve_plan_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Approve a plan.

        Approve a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_approve_plan_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_approve_plan_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Approve a plan.

        Approve a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_approve_plan_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_approve_plan_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_approve_plan'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_approve_plan'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_approve_plan',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_competency_framework_viewed_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency framework id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Log event competency framework viewed

        Log event competency framework viewed

        :param id: The competency framework id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_competency_framework_viewed_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_competency_framework_viewed(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency framework id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Log event competency framework viewed

        Log event competency framework viewed

        :param id: The competency framework id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_competency_framework_viewed_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_competency_framework_viewed_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_competency_framework_viewed_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency framework id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Log event competency framework viewed

        Log event competency framework viewed

        :param id: The competency framework id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_competency_framework_viewed_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_competency_framework_viewed_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency framework id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Log event competency framework viewed

        Log event competency framework viewed

        :param id: The competency framework id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_competency_framework_viewed_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_competency_framework_viewed_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_competency_framework_viewed'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_competency_framework_viewed'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_competency_framework_viewed',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_competency_viewed_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Log event competency viewed

        Log event competency viewed

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_competency_viewed_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_competency_viewed(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Log event competency viewed

        Log event competency viewed

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_competency_viewed_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_competency_viewed_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_competency_viewed_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Log event competency viewed

        Log event competency viewed

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_competency_viewed_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_competency_viewed_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Log event competency viewed

        Log event competency viewed

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_competency_viewed_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_competency_viewed_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_competency_viewed'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_competency_viewed'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_competency_viewed',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_complete_plan_args(
        self,
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Complete learning plan.

        Complete learning plan.

        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_complete_plan_serialize(
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_complete_plan(
        self,
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Complete learning plan.

        Complete learning plan.

        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_complete_plan_serialize(
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_complete_plan_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_complete_plan_with_http_info(
        self,
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Complete learning plan.

        Complete learning plan.

        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_complete_plan_serialize(
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_complete_plan_without_preload_content(
        self,
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Complete learning plan.

        Complete learning plan.

        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_complete_plan_serialize(
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_complete_plan_serialize(
        self,
        planid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_complete_plan'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_complete_plan'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_complete_plan',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if planid is not None:
            _form_params += parse_form({'planid': planid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_count_competencies_args(
        self,
        filters: List[CoreCompetencyCountCompetenciesParametersFiltersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Count a list of a competencies.

        Count a list of a competencies.

        :param filters: (required)
        :type filters: List[CoreCompetencyCountCompetenciesParametersFiltersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_competencies_serialize(
            filters=filters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_count_competencies(
        self,
        filters: List[CoreCompetencyCountCompetenciesParametersFiltersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> int:
        """Count a list of a competencies.

        Count a list of a competencies.

        :param filters: (required)
        :type filters: List[CoreCompetencyCountCompetenciesParametersFiltersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_competencies_serialize(
            filters=filters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_count_competencies_from_args(
        self,
        args
    ) -> int:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_count_competencies_with_http_info(
        self,
        filters: List[CoreCompetencyCountCompetenciesParametersFiltersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[int]:
        """Count a list of a competencies.

        Count a list of a competencies.

        :param filters: (required)
        :type filters: List[CoreCompetencyCountCompetenciesParametersFiltersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_competencies_serialize(
            filters=filters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_count_competencies_without_preload_content(
        self,
        filters: List[CoreCompetencyCountCompetenciesParametersFiltersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Count a list of a competencies.

        Count a list of a competencies.

        :param filters: (required)
        :type filters: List[CoreCompetencyCountCompetenciesParametersFiltersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_competencies_serialize(
            filters=filters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_count_competencies_serialize(
        self,
        filters,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'filters': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_competency_count_competencies'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_count_competencies'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_count_competencies',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if filters is not None:
            _form_params += parse_form({'filters': filters})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_count_competencies_in_course_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """List the competencies in a course

        List the competencies in a course

        :param id: The course id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_competencies_in_course_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_count_competencies_in_course(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> int:
        """List the competencies in a course

        List the competencies in a course

        :param id: The course id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_competencies_in_course_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_count_competencies_in_course_from_args(
        self,
        args
    ) -> int:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_count_competencies_in_course_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[int]:
        """List the competencies in a course

        List the competencies in a course

        :param id: The course id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_competencies_in_course_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_count_competencies_in_course_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List the competencies in a course

        List the competencies in a course

        :param id: The course id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_competencies_in_course_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_count_competencies_in_course_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_count_competencies_in_course'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_count_competencies_in_course'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_count_competencies_in_course',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_count_competencies_in_template_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Count a list of a competencies for a given template.

        Count a list of a competencies for a given template.

        :param id: The template id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_competencies_in_template_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_count_competencies_in_template(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> int:
        """Count a list of a competencies for a given template.

        Count a list of a competencies for a given template.

        :param id: The template id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_competencies_in_template_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_count_competencies_in_template_from_args(
        self,
        args
    ) -> int:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_count_competencies_in_template_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[int]:
        """Count a list of a competencies for a given template.

        Count a list of a competencies for a given template.

        :param id: The template id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_competencies_in_template_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_count_competencies_in_template_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Count a list of a competencies for a given template.

        Count a list of a competencies for a given template.

        :param id: The template id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_competencies_in_template_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_count_competencies_in_template_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_count_competencies_in_template'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_count_competencies_in_template'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_count_competencies_in_template',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_count_competency_frameworks_args(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        includes: Annotated[Optional[StrictStr], Field(description="What other contextes to fetch the frameworks from. (children, parents, self)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Count a list of a competency frameworks.

        Count a list of a competency frameworks.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param includes: What other contextes to fetch the frameworks from. (children, parents, self)
        :type includes: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_competency_frameworks_serialize(
            context=context,
            includes=includes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_count_competency_frameworks(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        includes: Annotated[Optional[StrictStr], Field(description="What other contextes to fetch the frameworks from. (children, parents, self)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> int:
        """Count a list of a competency frameworks.

        Count a list of a competency frameworks.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param includes: What other contextes to fetch the frameworks from. (children, parents, self)
        :type includes: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_competency_frameworks_serialize(
            context=context,
            includes=includes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_count_competency_frameworks_from_args(
        self,
        args
    ) -> int:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_count_competency_frameworks_with_http_info(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        includes: Annotated[Optional[StrictStr], Field(description="What other contextes to fetch the frameworks from. (children, parents, self)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[int]:
        """Count a list of a competency frameworks.

        Count a list of a competency frameworks.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param includes: What other contextes to fetch the frameworks from. (children, parents, self)
        :type includes: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_competency_frameworks_serialize(
            context=context,
            includes=includes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_count_competency_frameworks_without_preload_content(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        includes: Annotated[Optional[StrictStr], Field(description="What other contextes to fetch the frameworks from. (children, parents, self)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Count a list of a competency frameworks.

        Count a list of a competency frameworks.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param includes: What other contextes to fetch the frameworks from. (children, parents, self)
        :type includes: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_competency_frameworks_serialize(
            context=context,
            includes=includes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_count_competency_frameworks_serialize(
        self,
        context,
        includes,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_count_competency_frameworks'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_count_competency_frameworks'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_count_competency_frameworks',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if context is not None:
            _form_params += parse_form({'context': context})
        if includes is not None:
            _form_params += parse_form({'includes': includes})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_count_course_module_competencies_args(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The course module id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Count the competencies in a course module

        Count the competencies in a course module

        :param cmid: The course module id (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_course_module_competencies_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_count_course_module_competencies(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The course module id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> int:
        """Count the competencies in a course module

        Count the competencies in a course module

        :param cmid: The course module id (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_course_module_competencies_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_count_course_module_competencies_from_args(
        self,
        args
    ) -> int:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_count_course_module_competencies_with_http_info(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The course module id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[int]:
        """Count the competencies in a course module

        Count the competencies in a course module

        :param cmid: The course module id (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_course_module_competencies_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_count_course_module_competencies_without_preload_content(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The course module id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Count the competencies in a course module

        Count the competencies in a course module

        :param cmid: The course module id (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_course_module_competencies_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_count_course_module_competencies_serialize(
        self,
        cmid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_count_course_module_competencies'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_count_course_module_competencies'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_count_course_module_competencies',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_count_courses_using_competency_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """List the courses using a competency

        List the courses using a competency

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_courses_using_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_count_courses_using_competency(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> int:
        """List the courses using a competency

        List the courses using a competency

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_courses_using_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_count_courses_using_competency_from_args(
        self,
        args
    ) -> int:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_count_courses_using_competency_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[int]:
        """List the courses using a competency

        List the courses using a competency

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_courses_using_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_count_courses_using_competency_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List the courses using a competency

        List the courses using a competency

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_courses_using_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_count_courses_using_competency_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_count_courses_using_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_count_courses_using_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_count_courses_using_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_count_templates_args(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        includes: Annotated[Optional[StrictStr], Field(description="What other contextes to fetch the frameworks from. (children, parents, self)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Count a list of a learning plan templates.

        Count a list of a learning plan templates.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param includes: What other contextes to fetch the frameworks from. (children, parents, self)
        :type includes: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_templates_serialize(
            context=context,
            includes=includes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_count_templates(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        includes: Annotated[Optional[StrictStr], Field(description="What other contextes to fetch the frameworks from. (children, parents, self)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> int:
        """Count a list of a learning plan templates.

        Count a list of a learning plan templates.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param includes: What other contextes to fetch the frameworks from. (children, parents, self)
        :type includes: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_templates_serialize(
            context=context,
            includes=includes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_count_templates_from_args(
        self,
        args
    ) -> int:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_count_templates_with_http_info(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        includes: Annotated[Optional[StrictStr], Field(description="What other contextes to fetch the frameworks from. (children, parents, self)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[int]:
        """Count a list of a learning plan templates.

        Count a list of a learning plan templates.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param includes: What other contextes to fetch the frameworks from. (children, parents, self)
        :type includes: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_templates_serialize(
            context=context,
            includes=includes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_count_templates_without_preload_content(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        includes: Annotated[Optional[StrictStr], Field(description="What other contextes to fetch the frameworks from. (children, parents, self)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Count a list of a learning plan templates.

        Count a list of a learning plan templates.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param includes: What other contextes to fetch the frameworks from. (children, parents, self)
        :type includes: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_templates_serialize(
            context=context,
            includes=includes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_count_templates_serialize(
        self,
        context,
        includes,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_count_templates'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_count_templates'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_count_templates',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if context is not None:
            _form_params += parse_form({'context': context})
        if includes is not None:
            _form_params += parse_form({'includes': includes})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_count_templates_using_competency_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Count a list of a learning plan templates for a given competency.

        Count a list of a learning plan templates for a given competency.

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_templates_using_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_count_templates_using_competency(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> int:
        """Count a list of a learning plan templates for a given competency.

        Count a list of a learning plan templates for a given competency.

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_templates_using_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_count_templates_using_competency_from_args(
        self,
        args
    ) -> int:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_count_templates_using_competency_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[int]:
        """Count a list of a learning plan templates for a given competency.

        Count a list of a learning plan templates for a given competency.

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_templates_using_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_count_templates_using_competency_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Count a list of a learning plan templates for a given competency.

        Count a list of a learning plan templates for a given competency.

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_count_templates_using_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_count_templates_using_competency_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_count_templates_using_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_count_templates_using_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_count_templates_using_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_create_competency_args(
        self,
        competency: CoreCompetencyCreateCompetencyParametersCompetency,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Creates new competencies.

        Creates new competencies.

        :param competency: (required)
        :type competency: CoreCompetencyCreateCompetencyParametersCompetency
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_competency_serialize(
            competency=competency,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateCompetencyResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_create_competency(
        self,
        competency: CoreCompetencyCreateCompetencyParametersCompetency,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompetencyCreateCompetencyResponse:
        """Creates new competencies.

        Creates new competencies.

        :param competency: (required)
        :type competency: CoreCompetencyCreateCompetencyParametersCompetency
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_competency_serialize(
            competency=competency,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateCompetencyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_create_competency_from_args(
        self,
        args
    ) -> CoreCompetencyCreateCompetencyResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateCompetencyResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_create_competency_with_http_info(
        self,
        competency: CoreCompetencyCreateCompetencyParametersCompetency,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompetencyCreateCompetencyResponse]:
        """Creates new competencies.

        Creates new competencies.

        :param competency: (required)
        :type competency: CoreCompetencyCreateCompetencyParametersCompetency
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_competency_serialize(
            competency=competency,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateCompetencyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_create_competency_without_preload_content(
        self,
        competency: CoreCompetencyCreateCompetencyParametersCompetency,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Creates new competencies.

        Creates new competencies.

        :param competency: (required)
        :type competency: CoreCompetencyCreateCompetencyParametersCompetency
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_competency_serialize(
            competency=competency,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateCompetencyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_create_competency_serialize(
        self,
        competency,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_create_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_create_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_create_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competency is not None:
            _form_params += parse_form({'competency': competency})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_create_competency_framework_args(
        self,
        competencyframework: CoreCompetencyCreateCompetencyFrameworkParametersCompetencyframework,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Creates new competency frameworks.

        Creates new competency frameworks.

        :param competencyframework: (required)
        :type competencyframework: CoreCompetencyCreateCompetencyFrameworkParametersCompetencyframework
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_competency_framework_serialize(
            competencyframework=competencyframework,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateCompetencyFrameworkResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_create_competency_framework(
        self,
        competencyframework: CoreCompetencyCreateCompetencyFrameworkParametersCompetencyframework,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompetencyCreateCompetencyFrameworkResponse:
        """Creates new competency frameworks.

        Creates new competency frameworks.

        :param competencyframework: (required)
        :type competencyframework: CoreCompetencyCreateCompetencyFrameworkParametersCompetencyframework
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_competency_framework_serialize(
            competencyframework=competencyframework,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateCompetencyFrameworkResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_create_competency_framework_from_args(
        self,
        args
    ) -> CoreCompetencyCreateCompetencyFrameworkResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateCompetencyFrameworkResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_create_competency_framework_with_http_info(
        self,
        competencyframework: CoreCompetencyCreateCompetencyFrameworkParametersCompetencyframework,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompetencyCreateCompetencyFrameworkResponse]:
        """Creates new competency frameworks.

        Creates new competency frameworks.

        :param competencyframework: (required)
        :type competencyframework: CoreCompetencyCreateCompetencyFrameworkParametersCompetencyframework
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_competency_framework_serialize(
            competencyframework=competencyframework,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateCompetencyFrameworkResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_create_competency_framework_without_preload_content(
        self,
        competencyframework: CoreCompetencyCreateCompetencyFrameworkParametersCompetencyframework,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Creates new competency frameworks.

        Creates new competency frameworks.

        :param competencyframework: (required)
        :type competencyframework: CoreCompetencyCreateCompetencyFrameworkParametersCompetencyframework
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_competency_framework_serialize(
            competencyframework=competencyframework,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateCompetencyFrameworkResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_create_competency_framework_serialize(
        self,
        competencyframework,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_create_competency_framework'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_create_competency_framework'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_create_competency_framework',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyframework is not None:
            _form_params += parse_form({'competencyframework': competencyframework})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_create_plan_args(
        self,
        plan: CoreCompetencyCreatePlanParametersPlan,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Creates a learning plan.

        Creates a learning plan.

        :param plan: (required)
        :type plan: CoreCompetencyCreatePlanParametersPlan
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_plan_serialize(
            plan=plan,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreatePlanResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_create_plan(
        self,
        plan: CoreCompetencyCreatePlanParametersPlan,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompetencyCreatePlanResponse:
        """Creates a learning plan.

        Creates a learning plan.

        :param plan: (required)
        :type plan: CoreCompetencyCreatePlanParametersPlan
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_plan_serialize(
            plan=plan,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreatePlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_create_plan_from_args(
        self,
        args
    ) -> CoreCompetencyCreatePlanResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreatePlanResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_create_plan_with_http_info(
        self,
        plan: CoreCompetencyCreatePlanParametersPlan,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompetencyCreatePlanResponse]:
        """Creates a learning plan.

        Creates a learning plan.

        :param plan: (required)
        :type plan: CoreCompetencyCreatePlanParametersPlan
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_plan_serialize(
            plan=plan,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreatePlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_create_plan_without_preload_content(
        self,
        plan: CoreCompetencyCreatePlanParametersPlan,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Creates a learning plan.

        Creates a learning plan.

        :param plan: (required)
        :type plan: CoreCompetencyCreatePlanParametersPlan
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_plan_serialize(
            plan=plan,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreatePlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_create_plan_serialize(
        self,
        plan,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_create_plan'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_create_plan'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_create_plan',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if plan is not None:
            _form_params += parse_form({'plan': plan})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_create_template_args(
        self,
        template: CoreCompetencyCreateTemplateParametersTemplate,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Creates new learning plan templates.

        Creates new learning plan templates.

        :param template: (required)
        :type template: CoreCompetencyCreateTemplateParametersTemplate
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_template_serialize(
            template=template,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateTemplateResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_create_template(
        self,
        template: CoreCompetencyCreateTemplateParametersTemplate,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompetencyCreateTemplateResponse:
        """Creates new learning plan templates.

        Creates new learning plan templates.

        :param template: (required)
        :type template: CoreCompetencyCreateTemplateParametersTemplate
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_template_serialize(
            template=template,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateTemplateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_create_template_from_args(
        self,
        args
    ) -> CoreCompetencyCreateTemplateResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateTemplateResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_create_template_with_http_info(
        self,
        template: CoreCompetencyCreateTemplateParametersTemplate,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompetencyCreateTemplateResponse]:
        """Creates new learning plan templates.

        Creates new learning plan templates.

        :param template: (required)
        :type template: CoreCompetencyCreateTemplateParametersTemplate
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_template_serialize(
            template=template,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateTemplateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_create_template_without_preload_content(
        self,
        template: CoreCompetencyCreateTemplateParametersTemplate,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Creates new learning plan templates.

        Creates new learning plan templates.

        :param template: (required)
        :type template: CoreCompetencyCreateTemplateParametersTemplate
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_template_serialize(
            template=template,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateTemplateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_create_template_serialize(
        self,
        template,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_create_template'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_create_template'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_create_template',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if template is not None:
            _form_params += parse_form({'template': template})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_create_user_evidence_competency_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID.")],
        userevidenceid: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Create an evidence of prior learning relationship with a competency.

        Create an evidence of prior learning relationship with a competency.

        :param competencyid: The competency ID. (required)
        :type competencyid: int
        :param userevidenceid: The user evidence ID. (required)
        :type userevidenceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_user_evidence_competency_serialize(
            competencyid=competencyid,
            userevidenceid=userevidenceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateUserEvidenceCompetencyResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_create_user_evidence_competency(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID.")],
        userevidenceid: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompetencyCreateUserEvidenceCompetencyResponse:
        """Create an evidence of prior learning relationship with a competency.

        Create an evidence of prior learning relationship with a competency.

        :param competencyid: The competency ID. (required)
        :type competencyid: int
        :param userevidenceid: The user evidence ID. (required)
        :type userevidenceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_user_evidence_competency_serialize(
            competencyid=competencyid,
            userevidenceid=userevidenceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateUserEvidenceCompetencyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_create_user_evidence_competency_from_args(
        self,
        args
    ) -> CoreCompetencyCreateUserEvidenceCompetencyResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateUserEvidenceCompetencyResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_create_user_evidence_competency_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID.")],
        userevidenceid: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompetencyCreateUserEvidenceCompetencyResponse]:
        """Create an evidence of prior learning relationship with a competency.

        Create an evidence of prior learning relationship with a competency.

        :param competencyid: The competency ID. (required)
        :type competencyid: int
        :param userevidenceid: The user evidence ID. (required)
        :type userevidenceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_user_evidence_competency_serialize(
            competencyid=competencyid,
            userevidenceid=userevidenceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateUserEvidenceCompetencyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_create_user_evidence_competency_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID.")],
        userevidenceid: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create an evidence of prior learning relationship with a competency.

        Create an evidence of prior learning relationship with a competency.

        :param competencyid: The competency ID. (required)
        :type competencyid: int
        :param userevidenceid: The user evidence ID. (required)
        :type userevidenceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_create_user_evidence_competency_serialize(
            competencyid=competencyid,
            userevidenceid=userevidenceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyCreateUserEvidenceCompetencyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_create_user_evidence_competency_serialize(
        self,
        competencyid,
        userevidenceid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_create_user_evidence_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_create_user_evidence_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_create_user_evidence_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if userevidenceid is not None:
            _form_params += parse_form({'userevidenceid': userevidenceid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_delete_competency_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete a competency.

        Delete a competency.

        :param id: Data base record id for the competency (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_delete_competency(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Delete a competency.

        Delete a competency.

        :param id: Data base record id for the competency (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_delete_competency_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_delete_competency_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Delete a competency.

        Delete a competency.

        :param id: Data base record id for the competency (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_delete_competency_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete a competency.

        Delete a competency.

        :param id: Data base record id for the competency (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_delete_competency_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_delete_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_delete_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_delete_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_delete_competency_framework_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the framework")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete a competency framework.

        Delete a competency framework.

        :param id: Data base record id for the framework (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_competency_framework_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_delete_competency_framework(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the framework")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Delete a competency framework.

        Delete a competency framework.

        :param id: Data base record id for the framework (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_competency_framework_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_delete_competency_framework_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_delete_competency_framework_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the framework")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Delete a competency framework.

        Delete a competency framework.

        :param id: Data base record id for the framework (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_competency_framework_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_delete_competency_framework_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the framework")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete a competency framework.

        Delete a competency framework.

        :param id: Data base record id for the framework (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_competency_framework_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_delete_competency_framework_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_delete_competency_framework'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_delete_competency_framework'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_delete_competency_framework',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_delete_evidence_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The evidence ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete an evidence

        Delete an evidence

        :param id: The evidence ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_evidence_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_delete_evidence(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The evidence ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Delete an evidence

        Delete an evidence

        :param id: The evidence ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_evidence_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_delete_evidence_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_delete_evidence_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The evidence ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Delete an evidence

        Delete an evidence

        :param id: The evidence ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_evidence_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_delete_evidence_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The evidence ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete an evidence

        Delete an evidence

        :param id: The evidence ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_evidence_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_delete_evidence_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_delete_evidence'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_delete_evidence'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_delete_evidence',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_delete_plan_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the learning plan")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete a learning plan.

        Delete a learning plan.

        :param id: Data base record id for the learning plan (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_plan_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_delete_plan(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the learning plan")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Delete a learning plan.

        Delete a learning plan.

        :param id: Data base record id for the learning plan (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_plan_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_delete_plan_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_delete_plan_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the learning plan")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Delete a learning plan.

        Delete a learning plan.

        :param id: Data base record id for the learning plan (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_plan_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_delete_plan_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the learning plan")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete a learning plan.

        Delete a learning plan.

        :param id: Data base record id for the learning plan (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_plan_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_delete_plan_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_delete_plan'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_delete_plan'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_delete_plan',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_delete_template_args(
        self,
        deleteplans: Annotated[Optional[StrictBool], Field(description="Boolean to indicate if plans must be deleted")],
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the template")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete a learning plan template.

        Delete a learning plan template.

        :param deleteplans: Boolean to indicate if plans must be deleted (required)
        :type deleteplans: bool
        :param id: Data base record id for the template (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_template_serialize(
            deleteplans=deleteplans,
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_delete_template(
        self,
        deleteplans: Annotated[Optional[StrictBool], Field(description="Boolean to indicate if plans must be deleted")],
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the template")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Delete a learning plan template.

        Delete a learning plan template.

        :param deleteplans: Boolean to indicate if plans must be deleted (required)
        :type deleteplans: bool
        :param id: Data base record id for the template (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_template_serialize(
            deleteplans=deleteplans,
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_delete_template_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_delete_template_with_http_info(
        self,
        deleteplans: Annotated[Optional[StrictBool], Field(description="Boolean to indicate if plans must be deleted")],
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the template")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Delete a learning plan template.

        Delete a learning plan template.

        :param deleteplans: Boolean to indicate if plans must be deleted (required)
        :type deleteplans: bool
        :param id: Data base record id for the template (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_template_serialize(
            deleteplans=deleteplans,
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_delete_template_without_preload_content(
        self,
        deleteplans: Annotated[Optional[StrictBool], Field(description="Boolean to indicate if plans must be deleted")],
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the template")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete a learning plan template.

        Delete a learning plan template.

        :param deleteplans: Boolean to indicate if plans must be deleted (required)
        :type deleteplans: bool
        :param id: Data base record id for the template (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_template_serialize(
            deleteplans=deleteplans,
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_delete_template_serialize(
        self,
        deleteplans,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_delete_template'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_delete_template'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_delete_template',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if deleteplans is not None:
            _form_params += parse_form({'deleteplans': deleteplans})
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_delete_user_evidence_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete an evidence of prior learning.

        Delete an evidence of prior learning.

        :param id: The user evidence ID. (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_user_evidence_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_delete_user_evidence(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Delete an evidence of prior learning.

        Delete an evidence of prior learning.

        :param id: The user evidence ID. (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_user_evidence_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_delete_user_evidence_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_delete_user_evidence_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Delete an evidence of prior learning.

        Delete an evidence of prior learning.

        :param id: The user evidence ID. (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_user_evidence_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_delete_user_evidence_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete an evidence of prior learning.

        Delete an evidence of prior learning.

        :param id: The user evidence ID. (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_user_evidence_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_delete_user_evidence_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_delete_user_evidence'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_delete_user_evidence'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_delete_user_evidence',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_delete_user_evidence_competency_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID.")],
        userevidenceid: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete an evidence of prior learning relationship with a competency.

        Delete an evidence of prior learning relationship with a competency.

        :param competencyid: The competency ID. (required)
        :type competencyid: int
        :param userevidenceid: The user evidence ID. (required)
        :type userevidenceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_user_evidence_competency_serialize(
            competencyid=competencyid,
            userevidenceid=userevidenceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_delete_user_evidence_competency(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID.")],
        userevidenceid: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Delete an evidence of prior learning relationship with a competency.

        Delete an evidence of prior learning relationship with a competency.

        :param competencyid: The competency ID. (required)
        :type competencyid: int
        :param userevidenceid: The user evidence ID. (required)
        :type userevidenceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_user_evidence_competency_serialize(
            competencyid=competencyid,
            userevidenceid=userevidenceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_delete_user_evidence_competency_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_delete_user_evidence_competency_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID.")],
        userevidenceid: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Delete an evidence of prior learning relationship with a competency.

        Delete an evidence of prior learning relationship with a competency.

        :param competencyid: The competency ID. (required)
        :type competencyid: int
        :param userevidenceid: The user evidence ID. (required)
        :type userevidenceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_user_evidence_competency_serialize(
            competencyid=competencyid,
            userevidenceid=userevidenceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_delete_user_evidence_competency_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID.")],
        userevidenceid: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete an evidence of prior learning relationship with a competency.

        Delete an evidence of prior learning relationship with a competency.

        :param competencyid: The competency ID. (required)
        :type competencyid: int
        :param userevidenceid: The user evidence ID. (required)
        :type userevidenceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_delete_user_evidence_competency_serialize(
            competencyid=competencyid,
            userevidenceid=userevidenceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_delete_user_evidence_competency_serialize(
        self,
        competencyid,
        userevidenceid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_delete_user_evidence_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_delete_user_evidence_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_delete_user_evidence_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if userevidenceid is not None:
            _form_params += parse_form({'userevidenceid': userevidenceid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_duplicate_competency_framework_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the framework")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Duplicate a competency framework.

        Duplicate a competency framework.

        :param id: Data base record id for the framework (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_duplicate_competency_framework_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyDuplicateCompetencyFrameworkResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_duplicate_competency_framework(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the framework")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompetencyDuplicateCompetencyFrameworkResponse:
        """Duplicate a competency framework.

        Duplicate a competency framework.

        :param id: Data base record id for the framework (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_duplicate_competency_framework_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyDuplicateCompetencyFrameworkResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_duplicate_competency_framework_from_args(
        self,
        args
    ) -> CoreCompetencyDuplicateCompetencyFrameworkResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyDuplicateCompetencyFrameworkResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_duplicate_competency_framework_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the framework")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompetencyDuplicateCompetencyFrameworkResponse]:
        """Duplicate a competency framework.

        Duplicate a competency framework.

        :param id: Data base record id for the framework (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_duplicate_competency_framework_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyDuplicateCompetencyFrameworkResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_duplicate_competency_framework_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the framework")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Duplicate a competency framework.

        Duplicate a competency framework.

        :param id: Data base record id for the framework (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_duplicate_competency_framework_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyDuplicateCompetencyFrameworkResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_duplicate_competency_framework_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_duplicate_competency_framework'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_duplicate_competency_framework'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_duplicate_competency_framework',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_duplicate_template_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Duplicate learning plan template.

        Duplicate learning plan template.

        :param id: The template id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_duplicate_template_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyDuplicateTemplateResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_duplicate_template(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompetencyDuplicateTemplateResponse:
        """Duplicate learning plan template.

        Duplicate learning plan template.

        :param id: The template id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_duplicate_template_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyDuplicateTemplateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_duplicate_template_from_args(
        self,
        args
    ) -> CoreCompetencyDuplicateTemplateResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyDuplicateTemplateResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_duplicate_template_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompetencyDuplicateTemplateResponse]:
        """Duplicate learning plan template.

        Duplicate learning plan template.

        :param id: The template id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_duplicate_template_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyDuplicateTemplateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_duplicate_template_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Duplicate learning plan template.

        Duplicate learning plan template.

        :param id: The template id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_duplicate_template_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyDuplicateTemplateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_duplicate_template_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_duplicate_template'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_duplicate_template'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_duplicate_template',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_get_scale_values_args(
        self,
        scaleid: Annotated[Optional[StrictInt], Field(description="The scale id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetch the values for a specific scale

        Fetch the values for a specific scale

        :param scaleid: The scale id (required)
        :type scaleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_get_scale_values_serialize(
            scaleid=scaleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyGetScaleValuesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_get_scale_values(
        self,
        scaleid: Annotated[Optional[StrictInt], Field(description="The scale id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCompetencyGetScaleValuesResponseInner]:
        """Fetch the values for a specific scale

        Fetch the values for a specific scale

        :param scaleid: The scale id (required)
        :type scaleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_get_scale_values_serialize(
            scaleid=scaleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyGetScaleValuesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_get_scale_values_from_args(
        self,
        args
    ) -> List[CoreCompetencyGetScaleValuesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyGetScaleValuesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_get_scale_values_with_http_info(
        self,
        scaleid: Annotated[Optional[StrictInt], Field(description="The scale id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCompetencyGetScaleValuesResponseInner]]:
        """Fetch the values for a specific scale

        Fetch the values for a specific scale

        :param scaleid: The scale id (required)
        :type scaleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_get_scale_values_serialize(
            scaleid=scaleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyGetScaleValuesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_get_scale_values_without_preload_content(
        self,
        scaleid: Annotated[Optional[StrictInt], Field(description="The scale id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetch the values for a specific scale

        Fetch the values for a specific scale

        :param scaleid: The scale id (required)
        :type scaleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_get_scale_values_serialize(
            scaleid=scaleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyGetScaleValuesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_get_scale_values_serialize(
        self,
        scaleid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_get_scale_values'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_get_scale_values'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_get_scale_values',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if scaleid is not None:
            _form_params += parse_form({'scaleid': scaleid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_grade_competency_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Competency ID")],
        grade: Annotated[Optional[StrictInt], Field(description="New grade")],
        userid: Annotated[Optional[StrictInt], Field(description="User ID")],
        note: Annotated[Optional[StrictStr], Field(description="A note to attach to the evidence")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Grade a competency.

        Grade a competency.

        :param competencyid: Competency ID (required)
        :type competencyid: int
        :param grade: New grade (required)
        :type grade: int
        :param userid: User ID (required)
        :type userid: int
        :param note: A note to attach to the evidence
        :type note: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_grade_competency_serialize(
            competencyid=competencyid,
            grade=grade,
            userid=userid,
            note=note,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyGradeCompetencyResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_grade_competency(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Competency ID")],
        grade: Annotated[Optional[StrictInt], Field(description="New grade")],
        userid: Annotated[Optional[StrictInt], Field(description="User ID")],
        note: Annotated[Optional[StrictStr], Field(description="A note to attach to the evidence")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompetencyGradeCompetencyResponse:
        """Grade a competency.

        Grade a competency.

        :param competencyid: Competency ID (required)
        :type competencyid: int
        :param grade: New grade (required)
        :type grade: int
        :param userid: User ID (required)
        :type userid: int
        :param note: A note to attach to the evidence
        :type note: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_grade_competency_serialize(
            competencyid=competencyid,
            grade=grade,
            userid=userid,
            note=note,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyGradeCompetencyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_grade_competency_from_args(
        self,
        args
    ) -> CoreCompetencyGradeCompetencyResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyGradeCompetencyResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_grade_competency_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Competency ID")],
        grade: Annotated[Optional[StrictInt], Field(description="New grade")],
        userid: Annotated[Optional[StrictInt], Field(description="User ID")],
        note: Annotated[Optional[StrictStr], Field(description="A note to attach to the evidence")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompetencyGradeCompetencyResponse]:
        """Grade a competency.

        Grade a competency.

        :param competencyid: Competency ID (required)
        :type competencyid: int
        :param grade: New grade (required)
        :type grade: int
        :param userid: User ID (required)
        :type userid: int
        :param note: A note to attach to the evidence
        :type note: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_grade_competency_serialize(
            competencyid=competencyid,
            grade=grade,
            userid=userid,
            note=note,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyGradeCompetencyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_grade_competency_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Competency ID")],
        grade: Annotated[Optional[StrictInt], Field(description="New grade")],
        userid: Annotated[Optional[StrictInt], Field(description="User ID")],
        note: Annotated[Optional[StrictStr], Field(description="A note to attach to the evidence")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Grade a competency.

        Grade a competency.

        :param competencyid: Competency ID (required)
        :type competencyid: int
        :param grade: New grade (required)
        :type grade: int
        :param userid: User ID (required)
        :type userid: int
        :param note: A note to attach to the evidence
        :type note: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_grade_competency_serialize(
            competencyid=competencyid,
            grade=grade,
            userid=userid,
            note=note,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyGradeCompetencyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_grade_competency_serialize(
        self,
        competencyid,
        grade,
        userid,
        note,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_grade_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_grade_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_grade_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if grade is not None:
            _form_params += parse_form({'grade': grade})
        if note is not None:
            _form_params += parse_form({'note': note})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_grade_competency_in_course_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Competency id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course id")],
        grade: Annotated[Optional[StrictInt], Field(description="New grade")],
        userid: Annotated[Optional[StrictInt], Field(description="User id")],
        note: Annotated[Optional[StrictStr], Field(description="A note to attach to the evidence")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Grade a competency from the course page.

        Grade a competency from the course page.

        :param competencyid: Competency id (required)
        :type competencyid: int
        :param courseid: Course id (required)
        :type courseid: int
        :param grade: New grade (required)
        :type grade: int
        :param userid: User id (required)
        :type userid: int
        :param note: A note to attach to the evidence
        :type note: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_grade_competency_in_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            grade=grade,
            userid=userid,
            note=note,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyGradeCompetencyInCourseResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_grade_competency_in_course(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Competency id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course id")],
        grade: Annotated[Optional[StrictInt], Field(description="New grade")],
        userid: Annotated[Optional[StrictInt], Field(description="User id")],
        note: Annotated[Optional[StrictStr], Field(description="A note to attach to the evidence")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompetencyGradeCompetencyInCourseResponse:
        """Grade a competency from the course page.

        Grade a competency from the course page.

        :param competencyid: Competency id (required)
        :type competencyid: int
        :param courseid: Course id (required)
        :type courseid: int
        :param grade: New grade (required)
        :type grade: int
        :param userid: User id (required)
        :type userid: int
        :param note: A note to attach to the evidence
        :type note: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_grade_competency_in_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            grade=grade,
            userid=userid,
            note=note,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyGradeCompetencyInCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_grade_competency_in_course_from_args(
        self,
        args
    ) -> CoreCompetencyGradeCompetencyInCourseResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyGradeCompetencyInCourseResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_grade_competency_in_course_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Competency id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course id")],
        grade: Annotated[Optional[StrictInt], Field(description="New grade")],
        userid: Annotated[Optional[StrictInt], Field(description="User id")],
        note: Annotated[Optional[StrictStr], Field(description="A note to attach to the evidence")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompetencyGradeCompetencyInCourseResponse]:
        """Grade a competency from the course page.

        Grade a competency from the course page.

        :param competencyid: Competency id (required)
        :type competencyid: int
        :param courseid: Course id (required)
        :type courseid: int
        :param grade: New grade (required)
        :type grade: int
        :param userid: User id (required)
        :type userid: int
        :param note: A note to attach to the evidence
        :type note: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_grade_competency_in_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            grade=grade,
            userid=userid,
            note=note,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyGradeCompetencyInCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_grade_competency_in_course_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Competency id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course id")],
        grade: Annotated[Optional[StrictInt], Field(description="New grade")],
        userid: Annotated[Optional[StrictInt], Field(description="User id")],
        note: Annotated[Optional[StrictStr], Field(description="A note to attach to the evidence")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Grade a competency from the course page.

        Grade a competency from the course page.

        :param competencyid: Competency id (required)
        :type competencyid: int
        :param courseid: Course id (required)
        :type courseid: int
        :param grade: New grade (required)
        :type grade: int
        :param userid: User id (required)
        :type userid: int
        :param note: A note to attach to the evidence
        :type note: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_grade_competency_in_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            grade=grade,
            userid=userid,
            note=note,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyGradeCompetencyInCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_grade_competency_in_course_serialize(
        self,
        competencyid,
        courseid,
        grade,
        userid,
        note,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_grade_competency_in_course'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_grade_competency_in_course'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_grade_competency_in_course',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if grade is not None:
            _form_params += parse_form({'grade': grade})
        if note is not None:
            _form_params += parse_form({'note': note})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_grade_competency_in_plan_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Competency id")],
        grade: Annotated[Optional[StrictInt], Field(description="New grade")],
        planid: Annotated[Optional[StrictInt], Field(description="Plan id")],
        note: Annotated[Optional[StrictStr], Field(description="A note to attach to the evidence")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Grade a competency from the user plan page.

        Grade a competency from the user plan page.

        :param competencyid: Competency id (required)
        :type competencyid: int
        :param grade: New grade (required)
        :type grade: int
        :param planid: Plan id (required)
        :type planid: int
        :param note: A note to attach to the evidence
        :type note: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_grade_competency_in_plan_serialize(
            competencyid=competencyid,
            grade=grade,
            planid=planid,
            note=note,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyGradeCompetencyInPlanResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_grade_competency_in_plan(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Competency id")],
        grade: Annotated[Optional[StrictInt], Field(description="New grade")],
        planid: Annotated[Optional[StrictInt], Field(description="Plan id")],
        note: Annotated[Optional[StrictStr], Field(description="A note to attach to the evidence")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompetencyGradeCompetencyInPlanResponse:
        """Grade a competency from the user plan page.

        Grade a competency from the user plan page.

        :param competencyid: Competency id (required)
        :type competencyid: int
        :param grade: New grade (required)
        :type grade: int
        :param planid: Plan id (required)
        :type planid: int
        :param note: A note to attach to the evidence
        :type note: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_grade_competency_in_plan_serialize(
            competencyid=competencyid,
            grade=grade,
            planid=planid,
            note=note,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyGradeCompetencyInPlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_grade_competency_in_plan_from_args(
        self,
        args
    ) -> CoreCompetencyGradeCompetencyInPlanResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyGradeCompetencyInPlanResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_grade_competency_in_plan_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Competency id")],
        grade: Annotated[Optional[StrictInt], Field(description="New grade")],
        planid: Annotated[Optional[StrictInt], Field(description="Plan id")],
        note: Annotated[Optional[StrictStr], Field(description="A note to attach to the evidence")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompetencyGradeCompetencyInPlanResponse]:
        """Grade a competency from the user plan page.

        Grade a competency from the user plan page.

        :param competencyid: Competency id (required)
        :type competencyid: int
        :param grade: New grade (required)
        :type grade: int
        :param planid: Plan id (required)
        :type planid: int
        :param note: A note to attach to the evidence
        :type note: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_grade_competency_in_plan_serialize(
            competencyid=competencyid,
            grade=grade,
            planid=planid,
            note=note,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyGradeCompetencyInPlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_grade_competency_in_plan_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Competency id")],
        grade: Annotated[Optional[StrictInt], Field(description="New grade")],
        planid: Annotated[Optional[StrictInt], Field(description="Plan id")],
        note: Annotated[Optional[StrictStr], Field(description="A note to attach to the evidence")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Grade a competency from the user plan page.

        Grade a competency from the user plan page.

        :param competencyid: Competency id (required)
        :type competencyid: int
        :param grade: New grade (required)
        :type grade: int
        :param planid: Plan id (required)
        :type planid: int
        :param note: A note to attach to the evidence
        :type note: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_grade_competency_in_plan_serialize(
            competencyid=competencyid,
            grade=grade,
            planid=planid,
            note=note,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyGradeCompetencyInPlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_grade_competency_in_plan_serialize(
        self,
        competencyid,
        grade,
        planid,
        note,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_grade_competency_in_plan'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_grade_competency_in_plan'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_grade_competency_in_plan',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if grade is not None:
            _form_params += parse_form({'grade': grade})
        if note is not None:
            _form_params += parse_form({'note': note})
        if planid is not None:
            _form_params += parse_form({'planid': planid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_list_competencies_args(
        self,
        filters: List[CoreCompetencyCountCompetenciesParametersFiltersInner],
        limit: Annotated[Optional[StrictInt], Field(description="Return this number of records at most.")] = None,
        order: Annotated[Optional[StrictStr], Field(description="Sort direction. Should be either ASC or DESC")] = None,
        skip: Annotated[Optional[StrictInt], Field(description="Skip this number of records before returning results")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Column to sort by.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load a list of a competencies.

        Load a list of a competencies.

        :param filters: (required)
        :type filters: List[CoreCompetencyCountCompetenciesParametersFiltersInner]
        :param limit: Return this number of records at most.
        :type limit: int
        :param order: Sort direction. Should be either ASC or DESC
        :type order: str
        :param skip: Skip this number of records before returning results
        :type skip: int
        :param sort: Column to sort by.
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_competencies_serialize(
            filters=filters,
            limit=limit,
            order=order,
            skip=skip,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetenciesInTemplateResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_list_competencies(
        self,
        filters: List[CoreCompetencyCountCompetenciesParametersFiltersInner],
        limit: Annotated[Optional[StrictInt], Field(description="Return this number of records at most.")] = None,
        order: Annotated[Optional[StrictStr], Field(description="Sort direction. Should be either ASC or DESC")] = None,
        skip: Annotated[Optional[StrictInt], Field(description="Skip this number of records before returning results")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Column to sort by.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCompetencyListCompetenciesInTemplateResponseInner]:
        """Load a list of a competencies.

        Load a list of a competencies.

        :param filters: (required)
        :type filters: List[CoreCompetencyCountCompetenciesParametersFiltersInner]
        :param limit: Return this number of records at most.
        :type limit: int
        :param order: Sort direction. Should be either ASC or DESC
        :type order: str
        :param skip: Skip this number of records before returning results
        :type skip: int
        :param sort: Column to sort by.
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_competencies_serialize(
            filters=filters,
            limit=limit,
            order=order,
            skip=skip,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetenciesInTemplateResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_competencies_from_args(
        self,
        args
    ) -> List[CoreCompetencyListCompetenciesInTemplateResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetenciesInTemplateResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_competencies_with_http_info(
        self,
        filters: List[CoreCompetencyCountCompetenciesParametersFiltersInner],
        limit: Annotated[Optional[StrictInt], Field(description="Return this number of records at most.")] = None,
        order: Annotated[Optional[StrictStr], Field(description="Sort direction. Should be either ASC or DESC")] = None,
        skip: Annotated[Optional[StrictInt], Field(description="Skip this number of records before returning results")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Column to sort by.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCompetencyListCompetenciesInTemplateResponseInner]]:
        """Load a list of a competencies.

        Load a list of a competencies.

        :param filters: (required)
        :type filters: List[CoreCompetencyCountCompetenciesParametersFiltersInner]
        :param limit: Return this number of records at most.
        :type limit: int
        :param order: Sort direction. Should be either ASC or DESC
        :type order: str
        :param skip: Skip this number of records before returning results
        :type skip: int
        :param sort: Column to sort by.
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_competencies_serialize(
            filters=filters,
            limit=limit,
            order=order,
            skip=skip,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetenciesInTemplateResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_list_competencies_without_preload_content(
        self,
        filters: List[CoreCompetencyCountCompetenciesParametersFiltersInner],
        limit: Annotated[Optional[StrictInt], Field(description="Return this number of records at most.")] = None,
        order: Annotated[Optional[StrictStr], Field(description="Sort direction. Should be either ASC or DESC")] = None,
        skip: Annotated[Optional[StrictInt], Field(description="Skip this number of records before returning results")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Column to sort by.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load a list of a competencies.

        Load a list of a competencies.

        :param filters: (required)
        :type filters: List[CoreCompetencyCountCompetenciesParametersFiltersInner]
        :param limit: Return this number of records at most.
        :type limit: int
        :param order: Sort direction. Should be either ASC or DESC
        :type order: str
        :param skip: Skip this number of records before returning results
        :type skip: int
        :param sort: Column to sort by.
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_competencies_serialize(
            filters=filters,
            limit=limit,
            order=order,
            skip=skip,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetenciesInTemplateResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_list_competencies_serialize(
        self,
        filters,
        limit,
        order,
        skip,
        sort,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'filters': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_competency_list_competencies'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_list_competencies'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_list_competencies',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if filters is not None:
            _form_params += parse_form({'filters': filters})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if order is not None:
            _form_params += parse_form({'order': order})
        if skip is not None:
            _form_params += parse_form({'skip': skip})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_list_competencies_in_template_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load a list of a competencies for a given template.

        Load a list of a competencies for a given template.

        :param id: The template id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_competencies_in_template_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetenciesInTemplateResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_list_competencies_in_template(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCompetencyListCompetenciesInTemplateResponseInner]:
        """Load a list of a competencies for a given template.

        Load a list of a competencies for a given template.

        :param id: The template id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_competencies_in_template_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetenciesInTemplateResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_competencies_in_template_from_args(
        self,
        args
    ) -> List[CoreCompetencyListCompetenciesInTemplateResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetenciesInTemplateResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_competencies_in_template_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCompetencyListCompetenciesInTemplateResponseInner]]:
        """Load a list of a competencies for a given template.

        Load a list of a competencies for a given template.

        :param id: The template id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_competencies_in_template_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetenciesInTemplateResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_list_competencies_in_template_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load a list of a competencies for a given template.

        Load a list of a competencies for a given template.

        :param id: The template id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_competencies_in_template_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetenciesInTemplateResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_list_competencies_in_template_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_list_competencies_in_template'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_list_competencies_in_template'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_list_competencies_in_template',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_list_competency_frameworks_args(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        includes: Annotated[Optional[StrictStr], Field(description="What other contextes to fetch the frameworks from. (children, parents, self)")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Return this number of records at most.")] = None,
        onlyvisible: Annotated[Optional[StrictBool], Field(description="Only visible frameworks will be returned if visible true")] = None,
        order: Annotated[Optional[StrictStr], Field(description="Sort direction. Should be either ASC or DESC")] = None,
        query: Annotated[Optional[StrictStr], Field(description="A query string to filter the results")] = None,
        skip: Annotated[Optional[StrictInt], Field(description="Skip this number of records before returning results")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Column to sort by.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load a list of a competency frameworks.

        Load a list of a competency frameworks.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param includes: What other contextes to fetch the frameworks from. (children, parents, self)
        :type includes: str
        :param limit: Return this number of records at most.
        :type limit: int
        :param onlyvisible: Only visible frameworks will be returned if visible true
        :type onlyvisible: bool
        :param order: Sort direction. Should be either ASC or DESC
        :type order: str
        :param query: A query string to filter the results
        :type query: str
        :param skip: Skip this number of records before returning results
        :type skip: int
        :param sort: Column to sort by.
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_competency_frameworks_serialize(
            context=context,
            includes=includes,
            limit=limit,
            onlyvisible=onlyvisible,
            order=order,
            query=query,
            skip=skip,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetencyFrameworksResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_list_competency_frameworks(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        includes: Annotated[Optional[StrictStr], Field(description="What other contextes to fetch the frameworks from. (children, parents, self)")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Return this number of records at most.")] = None,
        onlyvisible: Annotated[Optional[StrictBool], Field(description="Only visible frameworks will be returned if visible true")] = None,
        order: Annotated[Optional[StrictStr], Field(description="Sort direction. Should be either ASC or DESC")] = None,
        query: Annotated[Optional[StrictStr], Field(description="A query string to filter the results")] = None,
        skip: Annotated[Optional[StrictInt], Field(description="Skip this number of records before returning results")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Column to sort by.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCompetencyListCompetencyFrameworksResponseInner]:
        """Load a list of a competency frameworks.

        Load a list of a competency frameworks.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param includes: What other contextes to fetch the frameworks from. (children, parents, self)
        :type includes: str
        :param limit: Return this number of records at most.
        :type limit: int
        :param onlyvisible: Only visible frameworks will be returned if visible true
        :type onlyvisible: bool
        :param order: Sort direction. Should be either ASC or DESC
        :type order: str
        :param query: A query string to filter the results
        :type query: str
        :param skip: Skip this number of records before returning results
        :type skip: int
        :param sort: Column to sort by.
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_competency_frameworks_serialize(
            context=context,
            includes=includes,
            limit=limit,
            onlyvisible=onlyvisible,
            order=order,
            query=query,
            skip=skip,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetencyFrameworksResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_competency_frameworks_from_args(
        self,
        args
    ) -> List[CoreCompetencyListCompetencyFrameworksResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetencyFrameworksResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_competency_frameworks_with_http_info(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        includes: Annotated[Optional[StrictStr], Field(description="What other contextes to fetch the frameworks from. (children, parents, self)")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Return this number of records at most.")] = None,
        onlyvisible: Annotated[Optional[StrictBool], Field(description="Only visible frameworks will be returned if visible true")] = None,
        order: Annotated[Optional[StrictStr], Field(description="Sort direction. Should be either ASC or DESC")] = None,
        query: Annotated[Optional[StrictStr], Field(description="A query string to filter the results")] = None,
        skip: Annotated[Optional[StrictInt], Field(description="Skip this number of records before returning results")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Column to sort by.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCompetencyListCompetencyFrameworksResponseInner]]:
        """Load a list of a competency frameworks.

        Load a list of a competency frameworks.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param includes: What other contextes to fetch the frameworks from. (children, parents, self)
        :type includes: str
        :param limit: Return this number of records at most.
        :type limit: int
        :param onlyvisible: Only visible frameworks will be returned if visible true
        :type onlyvisible: bool
        :param order: Sort direction. Should be either ASC or DESC
        :type order: str
        :param query: A query string to filter the results
        :type query: str
        :param skip: Skip this number of records before returning results
        :type skip: int
        :param sort: Column to sort by.
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_competency_frameworks_serialize(
            context=context,
            includes=includes,
            limit=limit,
            onlyvisible=onlyvisible,
            order=order,
            query=query,
            skip=skip,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetencyFrameworksResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_list_competency_frameworks_without_preload_content(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        includes: Annotated[Optional[StrictStr], Field(description="What other contextes to fetch the frameworks from. (children, parents, self)")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Return this number of records at most.")] = None,
        onlyvisible: Annotated[Optional[StrictBool], Field(description="Only visible frameworks will be returned if visible true")] = None,
        order: Annotated[Optional[StrictStr], Field(description="Sort direction. Should be either ASC or DESC")] = None,
        query: Annotated[Optional[StrictStr], Field(description="A query string to filter the results")] = None,
        skip: Annotated[Optional[StrictInt], Field(description="Skip this number of records before returning results")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Column to sort by.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load a list of a competency frameworks.

        Load a list of a competency frameworks.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param includes: What other contextes to fetch the frameworks from. (children, parents, self)
        :type includes: str
        :param limit: Return this number of records at most.
        :type limit: int
        :param onlyvisible: Only visible frameworks will be returned if visible true
        :type onlyvisible: bool
        :param order: Sort direction. Should be either ASC or DESC
        :type order: str
        :param query: A query string to filter the results
        :type query: str
        :param skip: Skip this number of records before returning results
        :type skip: int
        :param sort: Column to sort by.
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_competency_frameworks_serialize(
            context=context,
            includes=includes,
            limit=limit,
            onlyvisible=onlyvisible,
            order=order,
            query=query,
            skip=skip,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetencyFrameworksResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_list_competency_frameworks_serialize(
        self,
        context,
        includes,
        limit,
        onlyvisible,
        order,
        query,
        skip,
        sort,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_list_competency_frameworks'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_list_competency_frameworks'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_list_competency_frameworks',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if context is not None:
            _form_params += parse_form({'context': context})
        if includes is not None:
            _form_params += parse_form({'includes': includes})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if onlyvisible is not None:
            _form_params += parse_form({'onlyvisible': onlyvisible})
        if order is not None:
            _form_params += parse_form({'order': order})
        if query is not None:
            _form_params += parse_form({'query': query})
        if skip is not None:
            _form_params += parse_form({'skip': skip})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_list_course_competencies_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """List the competencies in a course

        List the competencies in a course

        :param id: The course id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_course_competencies_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCourseCompetenciesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_list_course_competencies(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCompetencyListCourseCompetenciesResponseInner]:
        """List the competencies in a course

        List the competencies in a course

        :param id: The course id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_course_competencies_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCourseCompetenciesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_course_competencies_from_args(
        self,
        args
    ) -> List[CoreCompetencyListCourseCompetenciesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCourseCompetenciesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_course_competencies_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCompetencyListCourseCompetenciesResponseInner]]:
        """List the competencies in a course

        List the competencies in a course

        :param id: The course id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_course_competencies_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCourseCompetenciesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_list_course_competencies_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List the competencies in a course

        List the competencies in a course

        :param id: The course id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_course_competencies_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCourseCompetenciesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_list_course_competencies_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_list_course_competencies'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_list_course_competencies'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_list_course_competencies',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_list_course_module_competencies_args(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The course module id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """List the competencies in a course module

        List the competencies in a course module

        :param cmid: The course module id (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_course_module_competencies_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCourseModuleCompetenciesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_list_course_module_competencies(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The course module id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCompetencyListCourseModuleCompetenciesResponseInner]:
        """List the competencies in a course module

        List the competencies in a course module

        :param cmid: The course module id (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_course_module_competencies_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCourseModuleCompetenciesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_course_module_competencies_from_args(
        self,
        args
    ) -> List[CoreCompetencyListCourseModuleCompetenciesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCourseModuleCompetenciesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_course_module_competencies_with_http_info(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The course module id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCompetencyListCourseModuleCompetenciesResponseInner]]:
        """List the competencies in a course module

        List the competencies in a course module

        :param cmid: The course module id (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_course_module_competencies_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCourseModuleCompetenciesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_list_course_module_competencies_without_preload_content(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The course module id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List the competencies in a course module

        List the competencies in a course module

        :param cmid: The course module id (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_course_module_competencies_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCourseModuleCompetenciesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_list_course_module_competencies_serialize(
        self,
        cmid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_list_course_module_competencies'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_list_course_module_competencies'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_list_course_module_competencies',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_list_plan_competencies_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """List the competencies in a plan

        List the competencies in a plan

        :param id: The plan ID. (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_plan_competencies_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListPlanCompetenciesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_list_plan_competencies(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCompetencyListPlanCompetenciesResponseInner]:
        """List the competencies in a plan

        List the competencies in a plan

        :param id: The plan ID. (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_plan_competencies_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListPlanCompetenciesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_plan_competencies_from_args(
        self,
        args
    ) -> List[CoreCompetencyListPlanCompetenciesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListPlanCompetenciesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_plan_competencies_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCompetencyListPlanCompetenciesResponseInner]]:
        """List the competencies in a plan

        List the competencies in a plan

        :param id: The plan ID. (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_plan_competencies_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListPlanCompetenciesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_list_plan_competencies_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List the competencies in a plan

        List the competencies in a plan

        :param id: The plan ID. (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_plan_competencies_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListPlanCompetenciesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_list_plan_competencies_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_list_plan_competencies'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_list_plan_competencies'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_list_plan_competencies',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_list_templates_args(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        includes: Annotated[Optional[StrictStr], Field(description="What other contexts to fetch the templates from. (children, parents, self)")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Return this number of records at most.")] = None,
        onlyvisible: Annotated[Optional[StrictBool], Field(description="If should list only visible templates")] = None,
        order: Annotated[Optional[StrictStr], Field(description="Sort direction. Should be either ASC or DESC")] = None,
        skip: Annotated[Optional[StrictInt], Field(description="Skip this number of records before returning results")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Column to sort by.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load a list of a learning plan templates.

        Load a list of a learning plan templates.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param includes: What other contexts to fetch the templates from. (children, parents, self)
        :type includes: str
        :param limit: Return this number of records at most.
        :type limit: int
        :param onlyvisible: If should list only visible templates
        :type onlyvisible: bool
        :param order: Sort direction. Should be either ASC or DESC
        :type order: str
        :param skip: Skip this number of records before returning results
        :type skip: int
        :param sort: Column to sort by.
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_templates_serialize(
            context=context,
            includes=includes,
            limit=limit,
            onlyvisible=onlyvisible,
            order=order,
            skip=skip,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyCreatePlanResponseTemplate]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_list_templates(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        includes: Annotated[Optional[StrictStr], Field(description="What other contexts to fetch the templates from. (children, parents, self)")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Return this number of records at most.")] = None,
        onlyvisible: Annotated[Optional[StrictBool], Field(description="If should list only visible templates")] = None,
        order: Annotated[Optional[StrictStr], Field(description="Sort direction. Should be either ASC or DESC")] = None,
        skip: Annotated[Optional[StrictInt], Field(description="Skip this number of records before returning results")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Column to sort by.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCompetencyCreatePlanResponseTemplate]:
        """Load a list of a learning plan templates.

        Load a list of a learning plan templates.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param includes: What other contexts to fetch the templates from. (children, parents, self)
        :type includes: str
        :param limit: Return this number of records at most.
        :type limit: int
        :param onlyvisible: If should list only visible templates
        :type onlyvisible: bool
        :param order: Sort direction. Should be either ASC or DESC
        :type order: str
        :param skip: Skip this number of records before returning results
        :type skip: int
        :param sort: Column to sort by.
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_templates_serialize(
            context=context,
            includes=includes,
            limit=limit,
            onlyvisible=onlyvisible,
            order=order,
            skip=skip,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyCreatePlanResponseTemplate]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_templates_from_args(
        self,
        args
    ) -> List[CoreCompetencyCreatePlanResponseTemplate]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyCreatePlanResponseTemplate]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_templates_with_http_info(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        includes: Annotated[Optional[StrictStr], Field(description="What other contexts to fetch the templates from. (children, parents, self)")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Return this number of records at most.")] = None,
        onlyvisible: Annotated[Optional[StrictBool], Field(description="If should list only visible templates")] = None,
        order: Annotated[Optional[StrictStr], Field(description="Sort direction. Should be either ASC or DESC")] = None,
        skip: Annotated[Optional[StrictInt], Field(description="Skip this number of records before returning results")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Column to sort by.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCompetencyCreatePlanResponseTemplate]]:
        """Load a list of a learning plan templates.

        Load a list of a learning plan templates.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param includes: What other contexts to fetch the templates from. (children, parents, self)
        :type includes: str
        :param limit: Return this number of records at most.
        :type limit: int
        :param onlyvisible: If should list only visible templates
        :type onlyvisible: bool
        :param order: Sort direction. Should be either ASC or DESC
        :type order: str
        :param skip: Skip this number of records before returning results
        :type skip: int
        :param sort: Column to sort by.
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_templates_serialize(
            context=context,
            includes=includes,
            limit=limit,
            onlyvisible=onlyvisible,
            order=order,
            skip=skip,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyCreatePlanResponseTemplate]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_list_templates_without_preload_content(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        includes: Annotated[Optional[StrictStr], Field(description="What other contexts to fetch the templates from. (children, parents, self)")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Return this number of records at most.")] = None,
        onlyvisible: Annotated[Optional[StrictBool], Field(description="If should list only visible templates")] = None,
        order: Annotated[Optional[StrictStr], Field(description="Sort direction. Should be either ASC or DESC")] = None,
        skip: Annotated[Optional[StrictInt], Field(description="Skip this number of records before returning results")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Column to sort by.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load a list of a learning plan templates.

        Load a list of a learning plan templates.

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param includes: What other contexts to fetch the templates from. (children, parents, self)
        :type includes: str
        :param limit: Return this number of records at most.
        :type limit: int
        :param onlyvisible: If should list only visible templates
        :type onlyvisible: bool
        :param order: Sort direction. Should be either ASC or DESC
        :type order: str
        :param skip: Skip this number of records before returning results
        :type skip: int
        :param sort: Column to sort by.
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_templates_serialize(
            context=context,
            includes=includes,
            limit=limit,
            onlyvisible=onlyvisible,
            order=order,
            skip=skip,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyCreatePlanResponseTemplate]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_list_templates_serialize(
        self,
        context,
        includes,
        limit,
        onlyvisible,
        order,
        skip,
        sort,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_list_templates'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_list_templates'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_list_templates',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if context is not None:
            _form_params += parse_form({'context': context})
        if includes is not None:
            _form_params += parse_form({'includes': includes})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if onlyvisible is not None:
            _form_params += parse_form({'onlyvisible': onlyvisible})
        if order is not None:
            _form_params += parse_form({'order': order})
        if skip is not None:
            _form_params += parse_form({'skip': skip})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_list_templates_using_competency_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load a list of a learning plan templates for a given competency.

        Load a list of a learning plan templates for a given competency.

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_templates_using_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyCreatePlanResponseTemplate]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_list_templates_using_competency(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCompetencyCreatePlanResponseTemplate]:
        """Load a list of a learning plan templates for a given competency.

        Load a list of a learning plan templates for a given competency.

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_templates_using_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyCreatePlanResponseTemplate]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_templates_using_competency_from_args(
        self,
        args
    ) -> List[CoreCompetencyCreatePlanResponseTemplate]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyCreatePlanResponseTemplate]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_templates_using_competency_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCompetencyCreatePlanResponseTemplate]]:
        """Load a list of a learning plan templates for a given competency.

        Load a list of a learning plan templates for a given competency.

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_templates_using_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyCreatePlanResponseTemplate]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_list_templates_using_competency_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load a list of a learning plan templates for a given competency.

        Load a list of a learning plan templates for a given competency.

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_templates_using_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyCreatePlanResponseTemplate]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_list_templates_using_competency_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_list_templates_using_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_list_templates_using_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_list_templates_using_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_list_user_plans_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """List a user's learning plans.

        List a user's learning plans.

        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_user_plans_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListUserPlansResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_list_user_plans(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCompetencyListUserPlansResponseInner]:
        """List a user's learning plans.

        List a user's learning plans.

        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_user_plans_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListUserPlansResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_user_plans_from_args(
        self,
        args
    ) -> List[CoreCompetencyListUserPlansResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListUserPlansResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_list_user_plans_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCompetencyListUserPlansResponseInner]]:
        """List a user's learning plans.

        List a user's learning plans.

        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_user_plans_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListUserPlansResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_list_user_plans_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List a user's learning plans.

        List a user's learning plans.

        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_list_user_plans_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListUserPlansResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_list_user_plans_serialize(
        self,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_list_user_plans'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_list_user_plans'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_list_user_plans',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_move_down_competency_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Re-order a competency.

        Re-order a competency.

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_move_down_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_move_down_competency(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Re-order a competency.

        Re-order a competency.

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_move_down_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_move_down_competency_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_move_down_competency_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Re-order a competency.

        Re-order a competency.

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_move_down_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_move_down_competency_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Re-order a competency.

        Re-order a competency.

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_move_down_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_move_down_competency_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_move_down_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_move_down_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_move_down_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_move_up_competency_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Re-order a competency.

        Re-order a competency.

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_move_up_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_move_up_competency(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Re-order a competency.

        Re-order a competency.

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_move_up_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_move_up_competency_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_move_up_competency_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Re-order a competency.

        Re-order a competency.

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_move_up_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_move_up_competency_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Re-order a competency.

        Re-order a competency.

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_move_up_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_move_up_competency_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_move_up_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_move_up_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_move_up_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_plan_cancel_review_request_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Cancel the review of a plan.

        Cancel the review of a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_plan_cancel_review_request_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_plan_cancel_review_request(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Cancel the review of a plan.

        Cancel the review of a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_plan_cancel_review_request_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_plan_cancel_review_request_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_plan_cancel_review_request_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Cancel the review of a plan.

        Cancel the review of a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_plan_cancel_review_request_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_plan_cancel_review_request_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Cancel the review of a plan.

        Cancel the review of a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_plan_cancel_review_request_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_plan_cancel_review_request_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_plan_cancel_review_request'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_plan_cancel_review_request'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_plan_cancel_review_request',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_plan_request_review_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Request for a plan to be reviewed.

        Request for a plan to be reviewed.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_plan_request_review_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_plan_request_review(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Request for a plan to be reviewed.

        Request for a plan to be reviewed.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_plan_request_review_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_plan_request_review_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_plan_request_review_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Request for a plan to be reviewed.

        Request for a plan to be reviewed.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_plan_request_review_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_plan_request_review_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Request for a plan to be reviewed.

        Request for a plan to be reviewed.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_plan_request_review_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_plan_request_review_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_plan_request_review'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_plan_request_review'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_plan_request_review',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_plan_start_review_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Start the review of a plan.

        Start the review of a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_plan_start_review_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_plan_start_review(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Start the review of a plan.

        Start the review of a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_plan_start_review_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_plan_start_review_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_plan_start_review_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Start the review of a plan.

        Start the review of a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_plan_start_review_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_plan_start_review_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Start the review of a plan.

        Start the review of a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_plan_start_review_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_plan_start_review_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_plan_start_review'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_plan_start_review'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_plan_start_review',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_plan_stop_review_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Stop the review of a plan.

        Stop the review of a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_plan_stop_review_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_plan_stop_review(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Stop the review of a plan.

        Stop the review of a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_plan_stop_review_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_plan_stop_review_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_plan_stop_review_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Stop the review of a plan.

        Stop the review of a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_plan_stop_review_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_plan_stop_review_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Stop the review of a plan.

        Stop the review of a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_plan_stop_review_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_plan_stop_review_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_plan_stop_review'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_plan_stop_review'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_plan_stop_review',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_read_competency_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load a summary of a competency.

        Load a summary of a competency.

        :param id: Data base record id for the competency (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadCompetencyResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_read_competency(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompetencyReadCompetencyResponse:
        """Load a summary of a competency.

        Load a summary of a competency.

        :param id: Data base record id for the competency (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadCompetencyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_read_competency_from_args(
        self,
        args
    ) -> CoreCompetencyReadCompetencyResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadCompetencyResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_read_competency_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompetencyReadCompetencyResponse]:
        """Load a summary of a competency.

        Load a summary of a competency.

        :param id: Data base record id for the competency (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadCompetencyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_read_competency_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load a summary of a competency.

        Load a summary of a competency.

        :param id: Data base record id for the competency (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadCompetencyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_read_competency_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_read_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_read_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_read_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_read_competency_framework_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the framework")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load a summary of a competency framework.

        Load a summary of a competency framework.

        :param id: Data base record id for the framework (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_competency_framework_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadCompetencyFrameworkResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_read_competency_framework(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the framework")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompetencyReadCompetencyFrameworkResponse:
        """Load a summary of a competency framework.

        Load a summary of a competency framework.

        :param id: Data base record id for the framework (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_competency_framework_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadCompetencyFrameworkResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_read_competency_framework_from_args(
        self,
        args
    ) -> CoreCompetencyReadCompetencyFrameworkResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadCompetencyFrameworkResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_read_competency_framework_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the framework")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompetencyReadCompetencyFrameworkResponse]:
        """Load a summary of a competency framework.

        Load a summary of a competency framework.

        :param id: Data base record id for the framework (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_competency_framework_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadCompetencyFrameworkResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_read_competency_framework_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the framework")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load a summary of a competency framework.

        Load a summary of a competency framework.

        :param id: Data base record id for the framework (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_competency_framework_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadCompetencyFrameworkResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_read_competency_framework_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_read_competency_framework'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_read_competency_framework'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_read_competency_framework',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_read_plan_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the plan")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load a learning plan.

        Load a learning plan.

        :param id: Data base record id for the plan (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_plan_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadPlanResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_read_plan(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the plan")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompetencyReadPlanResponse:
        """Load a learning plan.

        Load a learning plan.

        :param id: Data base record id for the plan (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_plan_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadPlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_read_plan_from_args(
        self,
        args
    ) -> CoreCompetencyReadPlanResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadPlanResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_read_plan_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the plan")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompetencyReadPlanResponse]:
        """Load a learning plan.

        Load a learning plan.

        :param id: Data base record id for the plan (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_plan_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadPlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_read_plan_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the plan")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load a learning plan.

        Load a learning plan.

        :param id: Data base record id for the plan (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_plan_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadPlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_read_plan_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_read_plan'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_read_plan'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_read_plan',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_read_template_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the template")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load a summary of a learning plan template.

        Load a summary of a learning plan template.

        :param id: Data base record id for the template (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_template_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadTemplateResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_read_template(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the template")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompetencyReadTemplateResponse:
        """Load a summary of a learning plan template.

        Load a summary of a learning plan template.

        :param id: Data base record id for the template (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_template_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadTemplateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_read_template_from_args(
        self,
        args
    ) -> CoreCompetencyReadTemplateResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadTemplateResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_read_template_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the template")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompetencyReadTemplateResponse]:
        """Load a summary of a learning plan template.

        Load a summary of a learning plan template.

        :param id: Data base record id for the template (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_template_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadTemplateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_read_template_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the template")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load a summary of a learning plan template.

        Load a summary of a learning plan template.

        :param id: Data base record id for the template (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_template_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadTemplateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_read_template_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_read_template'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_read_template'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_read_template',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_read_user_evidence_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Read an evidence of prior learning.

        Read an evidence of prior learning.

        :param id: The user evidence ID. (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_user_evidence_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadUserEvidenceResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_read_user_evidence(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompetencyReadUserEvidenceResponse:
        """Read an evidence of prior learning.

        Read an evidence of prior learning.

        :param id: The user evidence ID. (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_user_evidence_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadUserEvidenceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_read_user_evidence_from_args(
        self,
        args
    ) -> CoreCompetencyReadUserEvidenceResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadUserEvidenceResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_read_user_evidence_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompetencyReadUserEvidenceResponse]:
        """Read an evidence of prior learning.

        Read an evidence of prior learning.

        :param id: The user evidence ID. (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_user_evidence_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadUserEvidenceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_read_user_evidence_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Read an evidence of prior learning.

        Read an evidence of prior learning.

        :param id: The user evidence ID. (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_read_user_evidence_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyReadUserEvidenceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_read_user_evidence_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_read_user_evidence'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_read_user_evidence'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_read_user_evidence',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_remove_competency_from_course_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Remove a competency from a course

        Remove a competency from a course

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param courseid: The course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_remove_competency_from_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_remove_competency_from_course(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Remove a competency from a course

        Remove a competency from a course

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param courseid: The course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_remove_competency_from_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_remove_competency_from_course_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_remove_competency_from_course_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Remove a competency from a course

        Remove a competency from a course

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param courseid: The course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_remove_competency_from_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_remove_competency_from_course_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Remove a competency from a course

        Remove a competency from a course

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param courseid: The course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_remove_competency_from_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_remove_competency_from_course_serialize(
        self,
        competencyid,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_remove_competency_from_course'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_remove_competency_from_course'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_remove_competency_from_course',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_remove_competency_from_plan_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Remove the competency from a learning plan

        Remove the competency from a learning plan

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_remove_competency_from_plan_serialize(
            competencyid=competencyid,
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_remove_competency_from_plan(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Remove the competency from a learning plan

        Remove the competency from a learning plan

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_remove_competency_from_plan_serialize(
            competencyid=competencyid,
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_remove_competency_from_plan_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_remove_competency_from_plan_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Remove the competency from a learning plan

        Remove the competency from a learning plan

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_remove_competency_from_plan_serialize(
            competencyid=competencyid,
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_remove_competency_from_plan_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Remove the competency from a learning plan

        Remove the competency from a learning plan

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_remove_competency_from_plan_serialize(
            competencyid=competencyid,
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_remove_competency_from_plan_serialize(
        self,
        competencyid,
        planid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_remove_competency_from_plan'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_remove_competency_from_plan'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_remove_competency_from_plan',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if planid is not None:
            _form_params += parse_form({'planid': planid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_remove_competency_from_template_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        templateid: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Remove a competency from a template

        Remove a competency from a template

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param templateid: The template id (required)
        :type templateid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_remove_competency_from_template_serialize(
            competencyid=competencyid,
            templateid=templateid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_remove_competency_from_template(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        templateid: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Remove a competency from a template

        Remove a competency from a template

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param templateid: The template id (required)
        :type templateid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_remove_competency_from_template_serialize(
            competencyid=competencyid,
            templateid=templateid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_remove_competency_from_template_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_remove_competency_from_template_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        templateid: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Remove a competency from a template

        Remove a competency from a template

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param templateid: The template id (required)
        :type templateid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_remove_competency_from_template_serialize(
            competencyid=competencyid,
            templateid=templateid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_remove_competency_from_template_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        templateid: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Remove a competency from a template

        Remove a competency from a template

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param templateid: The template id (required)
        :type templateid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_remove_competency_from_template_serialize(
            competencyid=competencyid,
            templateid=templateid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_remove_competency_from_template_serialize(
        self,
        competencyid,
        templateid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_remove_competency_from_template'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_remove_competency_from_template'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_remove_competency_from_template',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if templateid is not None:
            _form_params += parse_form({'templateid': templateid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_remove_related_competency_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        relatedcompetencyid: Annotated[Optional[StrictInt], Field(description="The related competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Remove a related competency

        Remove a related competency

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param relatedcompetencyid: The related competency id (required)
        :type relatedcompetencyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_remove_related_competency_serialize(
            competencyid=competencyid,
            relatedcompetencyid=relatedcompetencyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_remove_related_competency(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        relatedcompetencyid: Annotated[Optional[StrictInt], Field(description="The related competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Remove a related competency

        Remove a related competency

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param relatedcompetencyid: The related competency id (required)
        :type relatedcompetencyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_remove_related_competency_serialize(
            competencyid=competencyid,
            relatedcompetencyid=relatedcompetencyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_remove_related_competency_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_remove_related_competency_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        relatedcompetencyid: Annotated[Optional[StrictInt], Field(description="The related competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Remove a related competency

        Remove a related competency

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param relatedcompetencyid: The related competency id (required)
        :type relatedcompetencyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_remove_related_competency_serialize(
            competencyid=competencyid,
            relatedcompetencyid=relatedcompetencyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_remove_related_competency_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        relatedcompetencyid: Annotated[Optional[StrictInt], Field(description="The related competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Remove a related competency

        Remove a related competency

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param relatedcompetencyid: The related competency id (required)
        :type relatedcompetencyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_remove_related_competency_serialize(
            competencyid=competencyid,
            relatedcompetencyid=relatedcompetencyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_remove_related_competency_serialize(
        self,
        competencyid,
        relatedcompetencyid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_remove_related_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_remove_related_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_remove_related_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if relatedcompetencyid is not None:
            _form_params += parse_form({'relatedcompetencyid': relatedcompetencyid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_reopen_plan_args(
        self,
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Reopen learning plan.

        Reopen learning plan.

        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_reopen_plan_serialize(
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_reopen_plan(
        self,
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Reopen learning plan.

        Reopen learning plan.

        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_reopen_plan_serialize(
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_reopen_plan_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_reopen_plan_with_http_info(
        self,
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Reopen learning plan.

        Reopen learning plan.

        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_reopen_plan_serialize(
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_reopen_plan_without_preload_content(
        self,
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Reopen learning plan.

        Reopen learning plan.

        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_reopen_plan_serialize(
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_reopen_plan_serialize(
        self,
        planid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_reopen_plan'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_reopen_plan'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_reopen_plan',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if planid is not None:
            _form_params += parse_form({'planid': planid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_reorder_course_competency_args(
        self,
        competencyidfrom: Annotated[Optional[StrictInt], Field(description="The competency id we are moving")],
        competencyidto: Annotated[Optional[StrictInt], Field(description="The competency id we are moving to")],
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Move a course competency to a new relative sort order.

        Move a course competency to a new relative sort order.

        :param competencyidfrom: The competency id we are moving (required)
        :type competencyidfrom: int
        :param competencyidto: The competency id we are moving to (required)
        :type competencyidto: int
        :param courseid: The course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_reorder_course_competency_serialize(
            competencyidfrom=competencyidfrom,
            competencyidto=competencyidto,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_reorder_course_competency(
        self,
        competencyidfrom: Annotated[Optional[StrictInt], Field(description="The competency id we are moving")],
        competencyidto: Annotated[Optional[StrictInt], Field(description="The competency id we are moving to")],
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Move a course competency to a new relative sort order.

        Move a course competency to a new relative sort order.

        :param competencyidfrom: The competency id we are moving (required)
        :type competencyidfrom: int
        :param competencyidto: The competency id we are moving to (required)
        :type competencyidto: int
        :param courseid: The course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_reorder_course_competency_serialize(
            competencyidfrom=competencyidfrom,
            competencyidto=competencyidto,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_reorder_course_competency_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_reorder_course_competency_with_http_info(
        self,
        competencyidfrom: Annotated[Optional[StrictInt], Field(description="The competency id we are moving")],
        competencyidto: Annotated[Optional[StrictInt], Field(description="The competency id we are moving to")],
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Move a course competency to a new relative sort order.

        Move a course competency to a new relative sort order.

        :param competencyidfrom: The competency id we are moving (required)
        :type competencyidfrom: int
        :param competencyidto: The competency id we are moving to (required)
        :type competencyidto: int
        :param courseid: The course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_reorder_course_competency_serialize(
            competencyidfrom=competencyidfrom,
            competencyidto=competencyidto,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_reorder_course_competency_without_preload_content(
        self,
        competencyidfrom: Annotated[Optional[StrictInt], Field(description="The competency id we are moving")],
        competencyidto: Annotated[Optional[StrictInt], Field(description="The competency id we are moving to")],
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Move a course competency to a new relative sort order.

        Move a course competency to a new relative sort order.

        :param competencyidfrom: The competency id we are moving (required)
        :type competencyidfrom: int
        :param competencyidto: The competency id we are moving to (required)
        :type competencyidto: int
        :param courseid: The course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_reorder_course_competency_serialize(
            competencyidfrom=competencyidfrom,
            competencyidto=competencyidto,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_reorder_course_competency_serialize(
        self,
        competencyidfrom,
        competencyidto,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_reorder_course_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_reorder_course_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_reorder_course_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyidfrom is not None:
            _form_params += parse_form({'competencyidfrom': competencyidfrom})
        if competencyidto is not None:
            _form_params += parse_form({'competencyidto': competencyidto})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_reorder_plan_competency_args(
        self,
        competencyidfrom: Annotated[Optional[StrictInt], Field(description="The competency id we are moving")],
        competencyidto: Annotated[Optional[StrictInt], Field(description="The competency id we are moving to")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Move a plan competency to a new relative sort order.

        Move a plan competency to a new relative sort order.

        :param competencyidfrom: The competency id we are moving (required)
        :type competencyidfrom: int
        :param competencyidto: The competency id we are moving to (required)
        :type competencyidto: int
        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_reorder_plan_competency_serialize(
            competencyidfrom=competencyidfrom,
            competencyidto=competencyidto,
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_reorder_plan_competency(
        self,
        competencyidfrom: Annotated[Optional[StrictInt], Field(description="The competency id we are moving")],
        competencyidto: Annotated[Optional[StrictInt], Field(description="The competency id we are moving to")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Move a plan competency to a new relative sort order.

        Move a plan competency to a new relative sort order.

        :param competencyidfrom: The competency id we are moving (required)
        :type competencyidfrom: int
        :param competencyidto: The competency id we are moving to (required)
        :type competencyidto: int
        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_reorder_plan_competency_serialize(
            competencyidfrom=competencyidfrom,
            competencyidto=competencyidto,
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_reorder_plan_competency_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_reorder_plan_competency_with_http_info(
        self,
        competencyidfrom: Annotated[Optional[StrictInt], Field(description="The competency id we are moving")],
        competencyidto: Annotated[Optional[StrictInt], Field(description="The competency id we are moving to")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Move a plan competency to a new relative sort order.

        Move a plan competency to a new relative sort order.

        :param competencyidfrom: The competency id we are moving (required)
        :type competencyidfrom: int
        :param competencyidto: The competency id we are moving to (required)
        :type competencyidto: int
        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_reorder_plan_competency_serialize(
            competencyidfrom=competencyidfrom,
            competencyidto=competencyidto,
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_reorder_plan_competency_without_preload_content(
        self,
        competencyidfrom: Annotated[Optional[StrictInt], Field(description="The competency id we are moving")],
        competencyidto: Annotated[Optional[StrictInt], Field(description="The competency id we are moving to")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Move a plan competency to a new relative sort order.

        Move a plan competency to a new relative sort order.

        :param competencyidfrom: The competency id we are moving (required)
        :type competencyidfrom: int
        :param competencyidto: The competency id we are moving to (required)
        :type competencyidto: int
        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_reorder_plan_competency_serialize(
            competencyidfrom=competencyidfrom,
            competencyidto=competencyidto,
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_reorder_plan_competency_serialize(
        self,
        competencyidfrom,
        competencyidto,
        planid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_reorder_plan_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_reorder_plan_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_reorder_plan_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyidfrom is not None:
            _form_params += parse_form({'competencyidfrom': competencyidfrom})
        if competencyidto is not None:
            _form_params += parse_form({'competencyidto': competencyidto})
        if planid is not None:
            _form_params += parse_form({'planid': planid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_reorder_template_competency_args(
        self,
        competencyidfrom: Annotated[Optional[StrictInt], Field(description="The competency id we are moving")],
        competencyidto: Annotated[Optional[StrictInt], Field(description="The competency id we are moving to")],
        templateid: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Move a template competency to a new relative sort order.

        Move a template competency to a new relative sort order.

        :param competencyidfrom: The competency id we are moving (required)
        :type competencyidfrom: int
        :param competencyidto: The competency id we are moving to (required)
        :type competencyidto: int
        :param templateid: The template id (required)
        :type templateid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_reorder_template_competency_serialize(
            competencyidfrom=competencyidfrom,
            competencyidto=competencyidto,
            templateid=templateid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_reorder_template_competency(
        self,
        competencyidfrom: Annotated[Optional[StrictInt], Field(description="The competency id we are moving")],
        competencyidto: Annotated[Optional[StrictInt], Field(description="The competency id we are moving to")],
        templateid: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Move a template competency to a new relative sort order.

        Move a template competency to a new relative sort order.

        :param competencyidfrom: The competency id we are moving (required)
        :type competencyidfrom: int
        :param competencyidto: The competency id we are moving to (required)
        :type competencyidto: int
        :param templateid: The template id (required)
        :type templateid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_reorder_template_competency_serialize(
            competencyidfrom=competencyidfrom,
            competencyidto=competencyidto,
            templateid=templateid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_reorder_template_competency_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_reorder_template_competency_with_http_info(
        self,
        competencyidfrom: Annotated[Optional[StrictInt], Field(description="The competency id we are moving")],
        competencyidto: Annotated[Optional[StrictInt], Field(description="The competency id we are moving to")],
        templateid: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Move a template competency to a new relative sort order.

        Move a template competency to a new relative sort order.

        :param competencyidfrom: The competency id we are moving (required)
        :type competencyidfrom: int
        :param competencyidto: The competency id we are moving to (required)
        :type competencyidto: int
        :param templateid: The template id (required)
        :type templateid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_reorder_template_competency_serialize(
            competencyidfrom=competencyidfrom,
            competencyidto=competencyidto,
            templateid=templateid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_reorder_template_competency_without_preload_content(
        self,
        competencyidfrom: Annotated[Optional[StrictInt], Field(description="The competency id we are moving")],
        competencyidto: Annotated[Optional[StrictInt], Field(description="The competency id we are moving to")],
        templateid: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Move a template competency to a new relative sort order.

        Move a template competency to a new relative sort order.

        :param competencyidfrom: The competency id we are moving (required)
        :type competencyidfrom: int
        :param competencyidto: The competency id we are moving to (required)
        :type competencyidto: int
        :param templateid: The template id (required)
        :type templateid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_reorder_template_competency_serialize(
            competencyidfrom=competencyidfrom,
            competencyidto=competencyidto,
            templateid=templateid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_reorder_template_competency_serialize(
        self,
        competencyidfrom,
        competencyidto,
        templateid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_reorder_template_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_reorder_template_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_reorder_template_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyidfrom is not None:
            _form_params += parse_form({'competencyidfrom': competencyidfrom})
        if competencyidto is not None:
            _form_params += parse_form({'competencyidto': competencyidto})
        if templateid is not None:
            _form_params += parse_form({'templateid': templateid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_request_review_of_user_evidence_linked_competencies_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Send user evidence competencies in review

        Send user evidence competencies in review

        :param id: The user evidence ID. (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_request_review_of_user_evidence_linked_competencies_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_request_review_of_user_evidence_linked_competencies(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Send user evidence competencies in review

        Send user evidence competencies in review

        :param id: The user evidence ID. (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_request_review_of_user_evidence_linked_competencies_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_request_review_of_user_evidence_linked_competencies_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_request_review_of_user_evidence_linked_competencies_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Send user evidence competencies in review

        Send user evidence competencies in review

        :param id: The user evidence ID. (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_request_review_of_user_evidence_linked_competencies_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_request_review_of_user_evidence_linked_competencies_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The user evidence ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Send user evidence competencies in review

        Send user evidence competencies in review

        :param id: The user evidence ID. (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_request_review_of_user_evidence_linked_competencies_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_request_review_of_user_evidence_linked_competencies_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_request_review_of_user_evidence_linked_competencies'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_request_review_of_user_evidence_linked_competencies'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_request_review_of_user_evidence_linked_competencies',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_search_competencies_args(
        self,
        competencyframeworkid: Annotated[Optional[StrictInt], Field(description="Competency framework id")],
        searchtext: Annotated[Optional[StrictStr], Field(description="Text to search for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Search a list of a competencies.

        Search a list of a competencies.

        :param competencyframeworkid: Competency framework id (required)
        :type competencyframeworkid: int
        :param searchtext: Text to search for (required)
        :type searchtext: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_search_competencies_serialize(
            competencyframeworkid=competencyframeworkid,
            searchtext=searchtext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetenciesInTemplateResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_search_competencies(
        self,
        competencyframeworkid: Annotated[Optional[StrictInt], Field(description="Competency framework id")],
        searchtext: Annotated[Optional[StrictStr], Field(description="Text to search for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCompetencyListCompetenciesInTemplateResponseInner]:
        """Search a list of a competencies.

        Search a list of a competencies.

        :param competencyframeworkid: Competency framework id (required)
        :type competencyframeworkid: int
        :param searchtext: Text to search for (required)
        :type searchtext: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_search_competencies_serialize(
            competencyframeworkid=competencyframeworkid,
            searchtext=searchtext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetenciesInTemplateResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_search_competencies_from_args(
        self,
        args
    ) -> List[CoreCompetencyListCompetenciesInTemplateResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetenciesInTemplateResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_search_competencies_with_http_info(
        self,
        competencyframeworkid: Annotated[Optional[StrictInt], Field(description="Competency framework id")],
        searchtext: Annotated[Optional[StrictStr], Field(description="Text to search for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCompetencyListCompetenciesInTemplateResponseInner]]:
        """Search a list of a competencies.

        Search a list of a competencies.

        :param competencyframeworkid: Competency framework id (required)
        :type competencyframeworkid: int
        :param searchtext: Text to search for (required)
        :type searchtext: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_search_competencies_serialize(
            competencyframeworkid=competencyframeworkid,
            searchtext=searchtext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetenciesInTemplateResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_search_competencies_without_preload_content(
        self,
        competencyframeworkid: Annotated[Optional[StrictInt], Field(description="Competency framework id")],
        searchtext: Annotated[Optional[StrictStr], Field(description="Text to search for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Search a list of a competencies.

        Search a list of a competencies.

        :param competencyframeworkid: Competency framework id (required)
        :type competencyframeworkid: int
        :param searchtext: Text to search for (required)
        :type searchtext: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_search_competencies_serialize(
            competencyframeworkid=competencyframeworkid,
            searchtext=searchtext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCompetencyListCompetenciesInTemplateResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_search_competencies_serialize(
        self,
        competencyframeworkid,
        searchtext,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_search_competencies'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_search_competencies'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_search_competencies',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyframeworkid is not None:
            _form_params += parse_form({'competencyframeworkid': competencyframeworkid})
        if searchtext is not None:
            _form_params += parse_form({'searchtext': searchtext})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_set_course_competency_ruleoutcome_args(
        self,
        coursecompetencyid: Annotated[Optional[StrictInt], Field(description="Data base record id for the course competency")],
        ruleoutcome: Annotated[Optional[StrictInt], Field(description="Ruleoutcome value")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Modify the ruleoutcome value for course competency

        Modify the ruleoutcome value for course competency

        :param coursecompetencyid: Data base record id for the course competency (required)
        :type coursecompetencyid: int
        :param ruleoutcome: Ruleoutcome value (required)
        :type ruleoutcome: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_set_course_competency_ruleoutcome_serialize(
            coursecompetencyid=coursecompetencyid,
            ruleoutcome=ruleoutcome,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_set_course_competency_ruleoutcome(
        self,
        coursecompetencyid: Annotated[Optional[StrictInt], Field(description="Data base record id for the course competency")],
        ruleoutcome: Annotated[Optional[StrictInt], Field(description="Ruleoutcome value")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Modify the ruleoutcome value for course competency

        Modify the ruleoutcome value for course competency

        :param coursecompetencyid: Data base record id for the course competency (required)
        :type coursecompetencyid: int
        :param ruleoutcome: Ruleoutcome value (required)
        :type ruleoutcome: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_set_course_competency_ruleoutcome_serialize(
            coursecompetencyid=coursecompetencyid,
            ruleoutcome=ruleoutcome,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_set_course_competency_ruleoutcome_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_set_course_competency_ruleoutcome_with_http_info(
        self,
        coursecompetencyid: Annotated[Optional[StrictInt], Field(description="Data base record id for the course competency")],
        ruleoutcome: Annotated[Optional[StrictInt], Field(description="Ruleoutcome value")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Modify the ruleoutcome value for course competency

        Modify the ruleoutcome value for course competency

        :param coursecompetencyid: Data base record id for the course competency (required)
        :type coursecompetencyid: int
        :param ruleoutcome: Ruleoutcome value (required)
        :type ruleoutcome: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_set_course_competency_ruleoutcome_serialize(
            coursecompetencyid=coursecompetencyid,
            ruleoutcome=ruleoutcome,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_set_course_competency_ruleoutcome_without_preload_content(
        self,
        coursecompetencyid: Annotated[Optional[StrictInt], Field(description="Data base record id for the course competency")],
        ruleoutcome: Annotated[Optional[StrictInt], Field(description="Ruleoutcome value")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Modify the ruleoutcome value for course competency

        Modify the ruleoutcome value for course competency

        :param coursecompetencyid: Data base record id for the course competency (required)
        :type coursecompetencyid: int
        :param ruleoutcome: Ruleoutcome value (required)
        :type ruleoutcome: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_set_course_competency_ruleoutcome_serialize(
            coursecompetencyid=coursecompetencyid,
            ruleoutcome=ruleoutcome,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_set_course_competency_ruleoutcome_serialize(
        self,
        coursecompetencyid,
        ruleoutcome,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_set_course_competency_ruleoutcome'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_set_course_competency_ruleoutcome'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_set_course_competency_ruleoutcome',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if coursecompetencyid is not None:
            _form_params += parse_form({'coursecompetencyid': coursecompetencyid})
        if ruleoutcome is not None:
            _form_params += parse_form({'ruleoutcome': ruleoutcome})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_set_parent_competency_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        parentid: Annotated[Optional[StrictInt], Field(description="The new competency parent id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set a new parent for a competency.

        Set a new parent for a competency.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param parentid: The new competency parent id (required)
        :type parentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_set_parent_competency_serialize(
            competencyid=competencyid,
            parentid=parentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_set_parent_competency(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        parentid: Annotated[Optional[StrictInt], Field(description="The new competency parent id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Set a new parent for a competency.

        Set a new parent for a competency.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param parentid: The new competency parent id (required)
        :type parentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_set_parent_competency_serialize(
            competencyid=competencyid,
            parentid=parentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_set_parent_competency_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_set_parent_competency_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        parentid: Annotated[Optional[StrictInt], Field(description="The new competency parent id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Set a new parent for a competency.

        Set a new parent for a competency.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param parentid: The new competency parent id (required)
        :type parentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_set_parent_competency_serialize(
            competencyid=competencyid,
            parentid=parentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_set_parent_competency_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        parentid: Annotated[Optional[StrictInt], Field(description="The new competency parent id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set a new parent for a competency.

        Set a new parent for a competency.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param parentid: The new competency parent id (required)
        :type parentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_set_parent_competency_serialize(
            competencyid=competencyid,
            parentid=parentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_set_parent_competency_serialize(
        self,
        competencyid,
        parentid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_set_parent_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_set_parent_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_set_parent_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if parentid is not None:
            _form_params += parse_form({'parentid': parentid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_template_has_related_data_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Check if a template has related data

        Check if a template has related data

        :param id: The template id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_template_has_related_data_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_template_has_related_data(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Check if a template has related data

        Check if a template has related data

        :param id: The template id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_template_has_related_data_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_template_has_related_data_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_template_has_related_data_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Check if a template has related data

        Check if a template has related data

        :param id: The template id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_template_has_related_data_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_template_has_related_data_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Check if a template has related data

        Check if a template has related data

        :param id: The template id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_template_has_related_data_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_template_has_related_data_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_template_has_related_data'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_template_has_related_data'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_template_has_related_data',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_template_viewed_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the template")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Log event template viewed

        Log event template viewed

        :param id: Data base record id for the template (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_template_viewed_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_template_viewed(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the template")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Log event template viewed

        Log event template viewed

        :param id: Data base record id for the template (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_template_viewed_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_template_viewed_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_template_viewed_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the template")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Log event template viewed

        Log event template viewed

        :param id: Data base record id for the template (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_template_viewed_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_template_viewed_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Data base record id for the template")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Log event template viewed

        Log event template viewed

        :param id: Data base record id for the template (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_template_viewed_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_template_viewed_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_template_viewed'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_template_viewed'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_template_viewed',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_unapprove_plan_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Unapprove a plan.

        Unapprove a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_unapprove_plan_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_unapprove_plan(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Unapprove a plan.

        Unapprove a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_unapprove_plan_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_unapprove_plan_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_unapprove_plan_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Unapprove a plan.

        Unapprove a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_unapprove_plan_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_unapprove_plan_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The plan ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Unapprove a plan.

        Unapprove a plan.

        :param id: The plan ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_unapprove_plan_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_unapprove_plan_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_unapprove_plan'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_unapprove_plan'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_unapprove_plan',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_unlink_plan_from_template_args(
        self,
        planid: Annotated[Optional[StrictInt], Field(description="Data base record id for the plan")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Unlink a plan form it template.

        Unlink a plan form it template.

        :param planid: Data base record id for the plan (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_unlink_plan_from_template_serialize(
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_unlink_plan_from_template(
        self,
        planid: Annotated[Optional[StrictInt], Field(description="Data base record id for the plan")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Unlink a plan form it template.

        Unlink a plan form it template.

        :param planid: Data base record id for the plan (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_unlink_plan_from_template_serialize(
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_unlink_plan_from_template_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_unlink_plan_from_template_with_http_info(
        self,
        planid: Annotated[Optional[StrictInt], Field(description="Data base record id for the plan")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Unlink a plan form it template.

        Unlink a plan form it template.

        :param planid: Data base record id for the plan (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_unlink_plan_from_template_serialize(
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_unlink_plan_from_template_without_preload_content(
        self,
        planid: Annotated[Optional[StrictInt], Field(description="Data base record id for the plan")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Unlink a plan form it template.

        Unlink a plan form it template.

        :param planid: Data base record id for the plan (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_unlink_plan_from_template_serialize(
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_unlink_plan_from_template_serialize(
        self,
        planid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_unlink_plan_from_template'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_unlink_plan_from_template'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_unlink_plan_from_template',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if planid is not None:
            _form_params += parse_form({'planid': planid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_update_competency_args(
        self,
        competency: CoreCompetencyUpdateCompetencyParametersCompetency,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update a competency.

        Update a competency.

        :param competency: (required)
        :type competency: CoreCompetencyUpdateCompetencyParametersCompetency
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_competency_serialize(
            competency=competency,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_update_competency(
        self,
        competency: CoreCompetencyUpdateCompetencyParametersCompetency,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Update a competency.

        Update a competency.

        :param competency: (required)
        :type competency: CoreCompetencyUpdateCompetencyParametersCompetency
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_competency_serialize(
            competency=competency,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_update_competency_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_update_competency_with_http_info(
        self,
        competency: CoreCompetencyUpdateCompetencyParametersCompetency,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Update a competency.

        Update a competency.

        :param competency: (required)
        :type competency: CoreCompetencyUpdateCompetencyParametersCompetency
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_competency_serialize(
            competency=competency,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_update_competency_without_preload_content(
        self,
        competency: CoreCompetencyUpdateCompetencyParametersCompetency,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update a competency.

        Update a competency.

        :param competency: (required)
        :type competency: CoreCompetencyUpdateCompetencyParametersCompetency
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_competency_serialize(
            competency=competency,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_update_competency_serialize(
        self,
        competency,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_update_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_update_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_update_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competency is not None:
            _form_params += parse_form({'competency': competency})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_update_competency_framework_args(
        self,
        competencyframework: CoreCompetencyUpdateCompetencyFrameworkParametersCompetencyframework,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update a competency framework.

        Update a competency framework.

        :param competencyframework: (required)
        :type competencyframework: CoreCompetencyUpdateCompetencyFrameworkParametersCompetencyframework
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_competency_framework_serialize(
            competencyframework=competencyframework,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_update_competency_framework(
        self,
        competencyframework: CoreCompetencyUpdateCompetencyFrameworkParametersCompetencyframework,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Update a competency framework.

        Update a competency framework.

        :param competencyframework: (required)
        :type competencyframework: CoreCompetencyUpdateCompetencyFrameworkParametersCompetencyframework
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_competency_framework_serialize(
            competencyframework=competencyframework,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_update_competency_framework_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_update_competency_framework_with_http_info(
        self,
        competencyframework: CoreCompetencyUpdateCompetencyFrameworkParametersCompetencyframework,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Update a competency framework.

        Update a competency framework.

        :param competencyframework: (required)
        :type competencyframework: CoreCompetencyUpdateCompetencyFrameworkParametersCompetencyframework
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_competency_framework_serialize(
            competencyframework=competencyframework,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_update_competency_framework_without_preload_content(
        self,
        competencyframework: CoreCompetencyUpdateCompetencyFrameworkParametersCompetencyframework,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update a competency framework.

        Update a competency framework.

        :param competencyframework: (required)
        :type competencyframework: CoreCompetencyUpdateCompetencyFrameworkParametersCompetencyframework
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_competency_framework_serialize(
            competencyframework=competencyframework,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_update_competency_framework_serialize(
        self,
        competencyframework,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_update_competency_framework'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_update_competency_framework'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_update_competency_framework',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyframework is not None:
            _form_params += parse_form({'competencyframework': competencyframework})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_update_course_competency_settings_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id for the course to update")],
        settings: CoreCompetencyUpdateCourseCompetencySettingsParametersSettings,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update the course competency settings

        Update the course competency settings

        :param courseid: Course id for the course to update (required)
        :type courseid: int
        :param settings: (required)
        :type settings: CoreCompetencyUpdateCourseCompetencySettingsParametersSettings
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_course_competency_settings_serialize(
            courseid=courseid,
            settings=settings,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_update_course_competency_settings(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id for the course to update")],
        settings: CoreCompetencyUpdateCourseCompetencySettingsParametersSettings,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Update the course competency settings

        Update the course competency settings

        :param courseid: Course id for the course to update (required)
        :type courseid: int
        :param settings: (required)
        :type settings: CoreCompetencyUpdateCourseCompetencySettingsParametersSettings
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_course_competency_settings_serialize(
            courseid=courseid,
            settings=settings,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_update_course_competency_settings_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_update_course_competency_settings_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id for the course to update")],
        settings: CoreCompetencyUpdateCourseCompetencySettingsParametersSettings,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Update the course competency settings

        Update the course competency settings

        :param courseid: Course id for the course to update (required)
        :type courseid: int
        :param settings: (required)
        :type settings: CoreCompetencyUpdateCourseCompetencySettingsParametersSettings
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_course_competency_settings_serialize(
            courseid=courseid,
            settings=settings,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_update_course_competency_settings_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id for the course to update")],
        settings: CoreCompetencyUpdateCourseCompetencySettingsParametersSettings,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update the course competency settings

        Update the course competency settings

        :param courseid: Course id for the course to update (required)
        :type courseid: int
        :param settings: (required)
        :type settings: CoreCompetencyUpdateCourseCompetencySettingsParametersSettings
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_course_competency_settings_serialize(
            courseid=courseid,
            settings=settings,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_update_course_competency_settings_serialize(
        self,
        courseid,
        settings,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_update_course_competency_settings'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_update_course_competency_settings'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_update_course_competency_settings',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if settings is not None:
            _form_params += parse_form({'settings': settings})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_update_plan_args(
        self,
        plan: CoreCompetencyUpdatePlanParametersPlan,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Updates a learning plan.

        Updates a learning plan.

        :param plan: (required)
        :type plan: CoreCompetencyUpdatePlanParametersPlan
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_plan_serialize(
            plan=plan,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyUpdatePlanResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_update_plan(
        self,
        plan: CoreCompetencyUpdatePlanParametersPlan,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompetencyUpdatePlanResponse:
        """Updates a learning plan.

        Updates a learning plan.

        :param plan: (required)
        :type plan: CoreCompetencyUpdatePlanParametersPlan
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_plan_serialize(
            plan=plan,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyUpdatePlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_update_plan_from_args(
        self,
        args
    ) -> CoreCompetencyUpdatePlanResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyUpdatePlanResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_update_plan_with_http_info(
        self,
        plan: CoreCompetencyUpdatePlanParametersPlan,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompetencyUpdatePlanResponse]:
        """Updates a learning plan.

        Updates a learning plan.

        :param plan: (required)
        :type plan: CoreCompetencyUpdatePlanParametersPlan
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_plan_serialize(
            plan=plan,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyUpdatePlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_update_plan_without_preload_content(
        self,
        plan: CoreCompetencyUpdatePlanParametersPlan,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Updates a learning plan.

        Updates a learning plan.

        :param plan: (required)
        :type plan: CoreCompetencyUpdatePlanParametersPlan
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_plan_serialize(
            plan=plan,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompetencyUpdatePlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_update_plan_serialize(
        self,
        plan,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_update_plan'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_update_plan'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_update_plan',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if plan is not None:
            _form_params += parse_form({'plan': plan})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_update_template_args(
        self,
        template: CoreCompetencyUpdateTemplateParametersTemplate,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update a learning plan template.

        Update a learning plan template.

        :param template: (required)
        :type template: CoreCompetencyUpdateTemplateParametersTemplate
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_template_serialize(
            template=template,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_update_template(
        self,
        template: CoreCompetencyUpdateTemplateParametersTemplate,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Update a learning plan template.

        Update a learning plan template.

        :param template: (required)
        :type template: CoreCompetencyUpdateTemplateParametersTemplate
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_template_serialize(
            template=template,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_update_template_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_update_template_with_http_info(
        self,
        template: CoreCompetencyUpdateTemplateParametersTemplate,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Update a learning plan template.

        Update a learning plan template.

        :param template: (required)
        :type template: CoreCompetencyUpdateTemplateParametersTemplate
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_template_serialize(
            template=template,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_update_template_without_preload_content(
        self,
        template: CoreCompetencyUpdateTemplateParametersTemplate,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update a learning plan template.

        Update a learning plan template.

        :param template: (required)
        :type template: CoreCompetencyUpdateTemplateParametersTemplate
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_update_template_serialize(
            template=template,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_update_template_serialize(
        self,
        template,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_update_template'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_update_template'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_update_template',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if template is not None:
            _form_params += parse_form({'template': template})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_user_competency_cancel_review_request_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID")],
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Cancel a review request.

        Cancel a review request.

        :param competencyid: The competency ID (required)
        :type competencyid: int
        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_cancel_review_request_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_user_competency_cancel_review_request(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID")],
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Cancel a review request.

        Cancel a review request.

        :param competencyid: The competency ID (required)
        :type competencyid: int
        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_cancel_review_request_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_user_competency_cancel_review_request_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_user_competency_cancel_review_request_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID")],
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Cancel a review request.

        Cancel a review request.

        :param competencyid: The competency ID (required)
        :type competencyid: int
        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_cancel_review_request_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_user_competency_cancel_review_request_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID")],
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Cancel a review request.

        Cancel a review request.

        :param competencyid: The competency ID (required)
        :type competencyid: int
        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_cancel_review_request_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_user_competency_cancel_review_request_serialize(
        self,
        competencyid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_user_competency_cancel_review_request'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_user_competency_cancel_review_request'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_user_competency_cancel_review_request',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_user_competency_plan_viewed_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Log the user competency plan viewed event.

        Log the user competency plan viewed event.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param planid: The plan id (required)
        :type planid: int
        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_plan_viewed_serialize(
            competencyid=competencyid,
            planid=planid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_user_competency_plan_viewed(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Log the user competency plan viewed event.

        Log the user competency plan viewed event.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param planid: The plan id (required)
        :type planid: int
        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_plan_viewed_serialize(
            competencyid=competencyid,
            planid=planid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_user_competency_plan_viewed_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_user_competency_plan_viewed_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Log the user competency plan viewed event.

        Log the user competency plan viewed event.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param planid: The plan id (required)
        :type planid: int
        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_plan_viewed_serialize(
            competencyid=competencyid,
            planid=planid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_user_competency_plan_viewed_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Log the user competency plan viewed event.

        Log the user competency plan viewed event.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param planid: The plan id (required)
        :type planid: int
        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_plan_viewed_serialize(
            competencyid=competencyid,
            planid=planid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_user_competency_plan_viewed_serialize(
        self,
        competencyid,
        planid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_user_competency_plan_viewed'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_user_competency_plan_viewed'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_user_competency_plan_viewed',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if planid is not None:
            _form_params += parse_form({'planid': planid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_user_competency_request_review_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID")],
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Request a review.

        Request a review.

        :param competencyid: The competency ID (required)
        :type competencyid: int
        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_request_review_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_user_competency_request_review(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID")],
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Request a review.

        Request a review.

        :param competencyid: The competency ID (required)
        :type competencyid: int
        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_request_review_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_user_competency_request_review_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_user_competency_request_review_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID")],
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Request a review.

        Request a review.

        :param competencyid: The competency ID (required)
        :type competencyid: int
        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_request_review_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_user_competency_request_review_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID")],
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Request a review.

        Request a review.

        :param competencyid: The competency ID (required)
        :type competencyid: int
        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_request_review_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_user_competency_request_review_serialize(
        self,
        competencyid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_user_competency_request_review'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_user_competency_request_review'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_user_competency_request_review',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_user_competency_start_review_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID")],
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Start a review.

        Start a review.

        :param competencyid: The competency ID (required)
        :type competencyid: int
        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_start_review_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_user_competency_start_review(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID")],
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Start a review.

        Start a review.

        :param competencyid: The competency ID (required)
        :type competencyid: int
        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_start_review_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_user_competency_start_review_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_user_competency_start_review_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID")],
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Start a review.

        Start a review.

        :param competencyid: The competency ID (required)
        :type competencyid: int
        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_start_review_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_user_competency_start_review_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID")],
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Start a review.

        Start a review.

        :param competencyid: The competency ID (required)
        :type competencyid: int
        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_start_review_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_user_competency_start_review_serialize(
        self,
        competencyid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_user_competency_start_review'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_user_competency_start_review'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_user_competency_start_review',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_user_competency_stop_review_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID")],
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Stop a review.

        Stop a review.

        :param competencyid: The competency ID (required)
        :type competencyid: int
        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_stop_review_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_user_competency_stop_review(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID")],
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Stop a review.

        Stop a review.

        :param competencyid: The competency ID (required)
        :type competencyid: int
        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_stop_review_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_user_competency_stop_review_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_user_competency_stop_review_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID")],
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Stop a review.

        Stop a review.

        :param competencyid: The competency ID (required)
        :type competencyid: int
        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_stop_review_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_user_competency_stop_review_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency ID")],
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Stop a review.

        Stop a review.

        :param competencyid: The competency ID (required)
        :type competencyid: int
        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_stop_review_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_user_competency_stop_review_serialize(
        self,
        competencyid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_user_competency_stop_review'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_user_competency_stop_review'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_user_competency_stop_review',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_user_competency_viewed_args(
        self,
        usercompetencyid: Annotated[Optional[StrictInt], Field(description="The user competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Log the user competency viewed event.

        Log the user competency viewed event.

        :param usercompetencyid: The user competency id (required)
        :type usercompetencyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_viewed_serialize(
            usercompetencyid=usercompetencyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_user_competency_viewed(
        self,
        usercompetencyid: Annotated[Optional[StrictInt], Field(description="The user competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Log the user competency viewed event.

        Log the user competency viewed event.

        :param usercompetencyid: The user competency id (required)
        :type usercompetencyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_viewed_serialize(
            usercompetencyid=usercompetencyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_user_competency_viewed_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_user_competency_viewed_with_http_info(
        self,
        usercompetencyid: Annotated[Optional[StrictInt], Field(description="The user competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Log the user competency viewed event.

        Log the user competency viewed event.

        :param usercompetencyid: The user competency id (required)
        :type usercompetencyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_viewed_serialize(
            usercompetencyid=usercompetencyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_user_competency_viewed_without_preload_content(
        self,
        usercompetencyid: Annotated[Optional[StrictInt], Field(description="The user competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Log the user competency viewed event.

        Log the user competency viewed event.

        :param usercompetencyid: The user competency id (required)
        :type usercompetencyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_viewed_serialize(
            usercompetencyid=usercompetencyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_user_competency_viewed_serialize(
        self,
        usercompetencyid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_user_competency_viewed'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_user_competency_viewed'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_user_competency_viewed',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if usercompetencyid is not None:
            _form_params += parse_form({'usercompetencyid': usercompetencyid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_user_competency_viewed_in_course_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Log the user competency viewed in course event

        Log the user competency viewed in course event

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param courseid: The course id (required)
        :type courseid: int
        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_viewed_in_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_user_competency_viewed_in_course(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Log the user competency viewed in course event

        Log the user competency viewed in course event

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param courseid: The course id (required)
        :type courseid: int
        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_viewed_in_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_user_competency_viewed_in_course_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_user_competency_viewed_in_course_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Log the user competency viewed in course event

        Log the user competency viewed in course event

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param courseid: The course id (required)
        :type courseid: int
        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_viewed_in_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_user_competency_viewed_in_course_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Log the user competency viewed in course event

        Log the user competency viewed in course event

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param courseid: The course id (required)
        :type courseid: int
        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_viewed_in_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_user_competency_viewed_in_course_serialize(
        self,
        competencyid,
        courseid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_user_competency_viewed_in_course'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_user_competency_viewed_in_course'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_user_competency_viewed_in_course',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_competency_user_competency_viewed_in_plan_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Log the user competency viewed in plan event.

        Log the user competency viewed in plan event.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param planid: The plan id (required)
        :type planid: int
        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_viewed_in_plan_serialize(
            competencyid=competencyid,
            planid=planid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_competency_user_competency_viewed_in_plan(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Log the user competency viewed in plan event.

        Log the user competency viewed in plan event.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param planid: The plan id (required)
        :type planid: int
        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_viewed_in_plan_serialize(
            competencyid=competencyid,
            planid=planid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_user_competency_viewed_in_plan_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_competency_user_competency_viewed_in_plan_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Log the user competency viewed in plan event.

        Log the user competency viewed in plan event.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param planid: The plan id (required)
        :type planid: int
        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_viewed_in_plan_serialize(
            competencyid=competencyid,
            planid=planid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_competency_user_competency_viewed_in_plan_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Log the user competency viewed in plan event.

        Log the user competency viewed in plan event.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param planid: The plan id (required)
        :type planid: int
        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_competency_user_competency_viewed_in_plan_serialize(
            competencyid=competencyid,
            planid=planid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_competency_user_competency_viewed_in_plan_serialize(
        self,
        competencyid,
        planid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_competency_user_competency_viewed_in_plan'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_competency_user_competency_viewed_in_plan'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_competency_user_competency_viewed_in_plan',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if planid is not None:
            _form_params += parse_form({'planid': planid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_completion_get_activities_completion_status_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        userid: Annotated[Optional[StrictInt], Field(description="User ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the activities completion status for a user in a course.

        Return the activities completion status for a user in a course.

        :param courseid: Course ID (required)
        :type courseid: int
        :param userid: User ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_get_activities_completion_status_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionGetActivitiesCompletionStatusResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_completion_get_activities_completion_status(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        userid: Annotated[Optional[StrictInt], Field(description="User ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompletionGetActivitiesCompletionStatusResponse:
        """Return the activities completion status for a user in a course.

        Return the activities completion status for a user in a course.

        :param courseid: Course ID (required)
        :type courseid: int
        :param userid: User ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_get_activities_completion_status_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionGetActivitiesCompletionStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_completion_get_activities_completion_status_from_args(
        self,
        args
    ) -> CoreCompletionGetActivitiesCompletionStatusResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionGetActivitiesCompletionStatusResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_completion_get_activities_completion_status_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        userid: Annotated[Optional[StrictInt], Field(description="User ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompletionGetActivitiesCompletionStatusResponse]:
        """Return the activities completion status for a user in a course.

        Return the activities completion status for a user in a course.

        :param courseid: Course ID (required)
        :type courseid: int
        :param userid: User ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_get_activities_completion_status_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionGetActivitiesCompletionStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_completion_get_activities_completion_status_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        userid: Annotated[Optional[StrictInt], Field(description="User ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the activities completion status for a user in a course.

        Return the activities completion status for a user in a course.

        :param courseid: Course ID (required)
        :type courseid: int
        :param userid: User ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_get_activities_completion_status_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionGetActivitiesCompletionStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_completion_get_activities_completion_status_serialize(
        self,
        courseid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_completion_get_activities_completion_status'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_completion_get_activities_completion_status'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_completion_get_activities_completion_status',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_completion_get_course_completion_status_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        userid: Annotated[Optional[StrictInt], Field(description="User ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns course completion status.

        Returns course completion status.

        :param courseid: Course ID (required)
        :type courseid: int
        :param userid: User ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_get_course_completion_status_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionGetCourseCompletionStatusResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_completion_get_course_completion_status(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        userid: Annotated[Optional[StrictInt], Field(description="User ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompletionGetCourseCompletionStatusResponse:
        """Returns course completion status.

        Returns course completion status.

        :param courseid: Course ID (required)
        :type courseid: int
        :param userid: User ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_get_course_completion_status_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionGetCourseCompletionStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_completion_get_course_completion_status_from_args(
        self,
        args
    ) -> CoreCompletionGetCourseCompletionStatusResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionGetCourseCompletionStatusResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_completion_get_course_completion_status_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        userid: Annotated[Optional[StrictInt], Field(description="User ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompletionGetCourseCompletionStatusResponse]:
        """Returns course completion status.

        Returns course completion status.

        :param courseid: Course ID (required)
        :type courseid: int
        :param userid: User ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_get_course_completion_status_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionGetCourseCompletionStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_completion_get_course_completion_status_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        userid: Annotated[Optional[StrictInt], Field(description="User ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns course completion status.

        Returns course completion status.

        :param courseid: Course ID (required)
        :type courseid: int
        :param userid: User ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_get_course_completion_status_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionGetCourseCompletionStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_completion_get_course_completion_status_serialize(
        self,
        courseid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_completion_get_course_completion_status'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_completion_get_course_completion_status'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_completion_get_course_completion_status',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_completion_mark_course_self_completed_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update the course completion status for the current user (if course self-completion is enabled).

        Update the course completion status for the current user (if course self-completion is enabled).

        :param courseid: Course ID (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_mark_course_self_completed_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionMarkCourseSelfCompletedResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_completion_mark_course_self_completed(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompletionMarkCourseSelfCompletedResponse:
        """Update the course completion status for the current user (if course self-completion is enabled).

        Update the course completion status for the current user (if course self-completion is enabled).

        :param courseid: Course ID (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_mark_course_self_completed_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionMarkCourseSelfCompletedResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_completion_mark_course_self_completed_from_args(
        self,
        args
    ) -> CoreCompletionMarkCourseSelfCompletedResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionMarkCourseSelfCompletedResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_completion_mark_course_self_completed_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompletionMarkCourseSelfCompletedResponse]:
        """Update the course completion status for the current user (if course self-completion is enabled).

        Update the course completion status for the current user (if course self-completion is enabled).

        :param courseid: Course ID (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_mark_course_self_completed_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionMarkCourseSelfCompletedResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_completion_mark_course_self_completed_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update the course completion status for the current user (if course self-completion is enabled).

        Update the course completion status for the current user (if course self-completion is enabled).

        :param courseid: Course ID (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_mark_course_self_completed_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionMarkCourseSelfCompletedResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_completion_mark_course_self_completed_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_completion_mark_course_self_completed'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_completion_mark_course_self_completed'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_completion_mark_course_self_completed',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_completion_override_activity_completion_status_args(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        newstate: Annotated[Optional[StrictInt], Field(description="the new activity completion state")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update completion status for a user in an activity by overriding it.

        Update completion status for a user in an activity by overriding it.

        :param cmid: course module id (required)
        :type cmid: int
        :param newstate: the new activity completion state (required)
        :type newstate: int
        :param userid: user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_override_activity_completion_status_serialize(
            cmid=cmid,
            newstate=newstate,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionOverrideActivityCompletionStatusResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_completion_override_activity_completion_status(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        newstate: Annotated[Optional[StrictInt], Field(description="the new activity completion state")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompletionOverrideActivityCompletionStatusResponse:
        """Update completion status for a user in an activity by overriding it.

        Update completion status for a user in an activity by overriding it.

        :param cmid: course module id (required)
        :type cmid: int
        :param newstate: the new activity completion state (required)
        :type newstate: int
        :param userid: user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_override_activity_completion_status_serialize(
            cmid=cmid,
            newstate=newstate,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionOverrideActivityCompletionStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_completion_override_activity_completion_status_from_args(
        self,
        args
    ) -> CoreCompletionOverrideActivityCompletionStatusResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionOverrideActivityCompletionStatusResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_completion_override_activity_completion_status_with_http_info(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        newstate: Annotated[Optional[StrictInt], Field(description="the new activity completion state")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompletionOverrideActivityCompletionStatusResponse]:
        """Update completion status for a user in an activity by overriding it.

        Update completion status for a user in an activity by overriding it.

        :param cmid: course module id (required)
        :type cmid: int
        :param newstate: the new activity completion state (required)
        :type newstate: int
        :param userid: user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_override_activity_completion_status_serialize(
            cmid=cmid,
            newstate=newstate,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionOverrideActivityCompletionStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_completion_override_activity_completion_status_without_preload_content(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        newstate: Annotated[Optional[StrictInt], Field(description="the new activity completion state")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update completion status for a user in an activity by overriding it.

        Update completion status for a user in an activity by overriding it.

        :param cmid: course module id (required)
        :type cmid: int
        :param newstate: the new activity completion state (required)
        :type newstate: int
        :param userid: user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_override_activity_completion_status_serialize(
            cmid=cmid,
            newstate=newstate,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionOverrideActivityCompletionStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_completion_override_activity_completion_status_serialize(
        self,
        cmid,
        newstate,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_completion_override_activity_completion_status'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_completion_override_activity_completion_status'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_completion_override_activity_completion_status',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        if newstate is not None:
            _form_params += parse_form({'newstate': newstate})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_completion_update_activity_completion_status_manually_args(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        completed: Annotated[Optional[StrictBool], Field(description="activity completed or not")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update completion status for the current user in an activity, only for activities with manual tracking.

        Update completion status for the current user in an activity, only for activities with manual tracking.

        :param cmid: course module id (required)
        :type cmid: int
        :param completed: activity completed or not (required)
        :type completed: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_update_activity_completion_status_manually_serialize(
            cmid=cmid,
            completed=completed,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionUpdateActivityCompletionStatusManuallyResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_completion_update_activity_completion_status_manually(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        completed: Annotated[Optional[StrictBool], Field(description="activity completed or not")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCompletionUpdateActivityCompletionStatusManuallyResponse:
        """Update completion status for the current user in an activity, only for activities with manual tracking.

        Update completion status for the current user in an activity, only for activities with manual tracking.

        :param cmid: course module id (required)
        :type cmid: int
        :param completed: activity completed or not (required)
        :type completed: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_update_activity_completion_status_manually_serialize(
            cmid=cmid,
            completed=completed,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionUpdateActivityCompletionStatusManuallyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_completion_update_activity_completion_status_manually_from_args(
        self,
        args
    ) -> CoreCompletionUpdateActivityCompletionStatusManuallyResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionUpdateActivityCompletionStatusManuallyResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_completion_update_activity_completion_status_manually_with_http_info(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        completed: Annotated[Optional[StrictBool], Field(description="activity completed or not")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCompletionUpdateActivityCompletionStatusManuallyResponse]:
        """Update completion status for the current user in an activity, only for activities with manual tracking.

        Update completion status for the current user in an activity, only for activities with manual tracking.

        :param cmid: course module id (required)
        :type cmid: int
        :param completed: activity completed or not (required)
        :type completed: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_update_activity_completion_status_manually_serialize(
            cmid=cmid,
            completed=completed,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionUpdateActivityCompletionStatusManuallyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_completion_update_activity_completion_status_manually_without_preload_content(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        completed: Annotated[Optional[StrictBool], Field(description="activity completed or not")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update completion status for the current user in an activity, only for activities with manual tracking.

        Update completion status for the current user in an activity, only for activities with manual tracking.

        :param cmid: course module id (required)
        :type cmid: int
        :param completed: activity completed or not (required)
        :type completed: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_completion_update_activity_completion_status_manually_serialize(
            cmid=cmid,
            completed=completed,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCompletionUpdateActivityCompletionStatusManuallyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_completion_update_activity_completion_status_manually_serialize(
        self,
        cmid,
        completed,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_completion_update_activity_completion_status_manually'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_completion_update_activity_completion_status_manually'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_completion_update_activity_completion_status_manually',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        if completed is not None:
            _form_params += parse_form({'completed': completed})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_contentbank_copy_content_args(
        self,
        contentid: Annotated[Optional[StrictInt], Field(description="The content id to copy")],
        name: Annotated[Optional[StrictStr], Field(description="The new name for the content")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Copy a content in the content bank.

        Copy a content in the content bank.

        :param contentid: The content id to copy (required)
        :type contentid: int
        :param name: The new name for the content (required)
        :type name: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_contentbank_copy_content_serialize(
            contentid=contentid,
            name=name,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankCopyContentResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_contentbank_copy_content(
        self,
        contentid: Annotated[Optional[StrictInt], Field(description="The content id to copy")],
        name: Annotated[Optional[StrictStr], Field(description="The new name for the content")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreContentbankCopyContentResponse:
        """Copy a content in the content bank.

        Copy a content in the content bank.

        :param contentid: The content id to copy (required)
        :type contentid: int
        :param name: The new name for the content (required)
        :type name: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_contentbank_copy_content_serialize(
            contentid=contentid,
            name=name,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankCopyContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_contentbank_copy_content_from_args(
        self,
        args
    ) -> CoreContentbankCopyContentResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankCopyContentResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_contentbank_copy_content_with_http_info(
        self,
        contentid: Annotated[Optional[StrictInt], Field(description="The content id to copy")],
        name: Annotated[Optional[StrictStr], Field(description="The new name for the content")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreContentbankCopyContentResponse]:
        """Copy a content in the content bank.

        Copy a content in the content bank.

        :param contentid: The content id to copy (required)
        :type contentid: int
        :param name: The new name for the content (required)
        :type name: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_contentbank_copy_content_serialize(
            contentid=contentid,
            name=name,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankCopyContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_contentbank_copy_content_without_preload_content(
        self,
        contentid: Annotated[Optional[StrictInt], Field(description="The content id to copy")],
        name: Annotated[Optional[StrictStr], Field(description="The new name for the content")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Copy a content in the content bank.

        Copy a content in the content bank.

        :param contentid: The content id to copy (required)
        :type contentid: int
        :param name: The new name for the content (required)
        :type name: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_contentbank_copy_content_serialize(
            contentid=contentid,
            name=name,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankCopyContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_contentbank_copy_content_serialize(
        self,
        contentid,
        name,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_contentbank_copy_content'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_contentbank_copy_content'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_contentbank_copy_content',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if contentid is not None:
            _form_params += parse_form({'contentid': contentid})
        if name is not None:
            _form_params += parse_form({'name': name})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_contentbank_delete_content_args(
        self,
        contentids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete a content from the content bank.

        Delete a content from the content bank.

        :param contentids: (required)
        :type contentids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_contentbank_delete_content_serialize(
            contentids=contentids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankDeleteContentResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_contentbank_delete_content(
        self,
        contentids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreContentbankDeleteContentResponse:
        """Delete a content from the content bank.

        Delete a content from the content bank.

        :param contentids: (required)
        :type contentids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_contentbank_delete_content_serialize(
            contentids=contentids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankDeleteContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_contentbank_delete_content_from_args(
        self,
        args
    ) -> CoreContentbankDeleteContentResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankDeleteContentResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_contentbank_delete_content_with_http_info(
        self,
        contentids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreContentbankDeleteContentResponse]:
        """Delete a content from the content bank.

        Delete a content from the content bank.

        :param contentids: (required)
        :type contentids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_contentbank_delete_content_serialize(
            contentids=contentids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankDeleteContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_contentbank_delete_content_without_preload_content(
        self,
        contentids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete a content from the content bank.

        Delete a content from the content bank.

        :param contentids: (required)
        :type contentids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_contentbank_delete_content_serialize(
            contentids=contentids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankDeleteContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_contentbank_delete_content_serialize(
        self,
        contentids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'contentids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_contentbank_delete_content'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_contentbank_delete_content'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_contentbank_delete_content',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if contentids is not None:
            _form_params += parse_form({'contentids': contentids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_contentbank_rename_content_args(
        self,
        contentid: Annotated[Optional[StrictInt], Field(description="The content id to rename")],
        name: Annotated[Optional[StrictStr], Field(description="The new name for the content")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Rename a content in the content bank.

        Rename a content in the content bank.

        :param contentid: The content id to rename (required)
        :type contentid: int
        :param name: The new name for the content (required)
        :type name: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_contentbank_rename_content_serialize(
            contentid=contentid,
            name=name,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankRenameContentResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_contentbank_rename_content(
        self,
        contentid: Annotated[Optional[StrictInt], Field(description="The content id to rename")],
        name: Annotated[Optional[StrictStr], Field(description="The new name for the content")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreContentbankRenameContentResponse:
        """Rename a content in the content bank.

        Rename a content in the content bank.

        :param contentid: The content id to rename (required)
        :type contentid: int
        :param name: The new name for the content (required)
        :type name: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_contentbank_rename_content_serialize(
            contentid=contentid,
            name=name,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankRenameContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_contentbank_rename_content_from_args(
        self,
        args
    ) -> CoreContentbankRenameContentResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankRenameContentResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_contentbank_rename_content_with_http_info(
        self,
        contentid: Annotated[Optional[StrictInt], Field(description="The content id to rename")],
        name: Annotated[Optional[StrictStr], Field(description="The new name for the content")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreContentbankRenameContentResponse]:
        """Rename a content in the content bank.

        Rename a content in the content bank.

        :param contentid: The content id to rename (required)
        :type contentid: int
        :param name: The new name for the content (required)
        :type name: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_contentbank_rename_content_serialize(
            contentid=contentid,
            name=name,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankRenameContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_contentbank_rename_content_without_preload_content(
        self,
        contentid: Annotated[Optional[StrictInt], Field(description="The content id to rename")],
        name: Annotated[Optional[StrictStr], Field(description="The new name for the content")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Rename a content in the content bank.

        Rename a content in the content bank.

        :param contentid: The content id to rename (required)
        :type contentid: int
        :param name: The new name for the content (required)
        :type name: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_contentbank_rename_content_serialize(
            contentid=contentid,
            name=name,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankRenameContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_contentbank_rename_content_serialize(
        self,
        contentid,
        name,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_contentbank_rename_content'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_contentbank_rename_content'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_contentbank_rename_content',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if contentid is not None:
            _form_params += parse_form({'contentid': contentid})
        if name is not None:
            _form_params += parse_form({'name': name})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_contentbank_set_content_visibility_args(
        self,
        contentid: Annotated[Optional[StrictInt], Field(description="The content id to rename")],
        visibility: Annotated[Optional[StrictInt], Field(description="The new visibility for the content")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set the visibility of a content in the content bank.

        Set the visibility of a content in the content bank.

        :param contentid: The content id to rename (required)
        :type contentid: int
        :param visibility: The new visibility for the content (required)
        :type visibility: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_contentbank_set_content_visibility_serialize(
            contentid=contentid,
            visibility=visibility,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankSetContentVisibilityResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_contentbank_set_content_visibility(
        self,
        contentid: Annotated[Optional[StrictInt], Field(description="The content id to rename")],
        visibility: Annotated[Optional[StrictInt], Field(description="The new visibility for the content")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreContentbankSetContentVisibilityResponse:
        """Set the visibility of a content in the content bank.

        Set the visibility of a content in the content bank.

        :param contentid: The content id to rename (required)
        :type contentid: int
        :param visibility: The new visibility for the content (required)
        :type visibility: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_contentbank_set_content_visibility_serialize(
            contentid=contentid,
            visibility=visibility,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankSetContentVisibilityResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_contentbank_set_content_visibility_from_args(
        self,
        args
    ) -> CoreContentbankSetContentVisibilityResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankSetContentVisibilityResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_contentbank_set_content_visibility_with_http_info(
        self,
        contentid: Annotated[Optional[StrictInt], Field(description="The content id to rename")],
        visibility: Annotated[Optional[StrictInt], Field(description="The new visibility for the content")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreContentbankSetContentVisibilityResponse]:
        """Set the visibility of a content in the content bank.

        Set the visibility of a content in the content bank.

        :param contentid: The content id to rename (required)
        :type contentid: int
        :param visibility: The new visibility for the content (required)
        :type visibility: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_contentbank_set_content_visibility_serialize(
            contentid=contentid,
            visibility=visibility,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankSetContentVisibilityResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_contentbank_set_content_visibility_without_preload_content(
        self,
        contentid: Annotated[Optional[StrictInt], Field(description="The content id to rename")],
        visibility: Annotated[Optional[StrictInt], Field(description="The new visibility for the content")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set the visibility of a content in the content bank.

        Set the visibility of a content in the content bank.

        :param contentid: The content id to rename (required)
        :type contentid: int
        :param visibility: The new visibility for the content (required)
        :type visibility: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_contentbank_set_content_visibility_serialize(
            contentid=contentid,
            visibility=visibility,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreContentbankSetContentVisibilityResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_contentbank_set_content_visibility_serialize(
        self,
        contentid,
        visibility,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_contentbank_set_content_visibility'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_contentbank_set_content_visibility'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_contentbank_set_content_visibility',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if contentid is not None:
            _form_params += parse_form({'contentid': contentid})
        if visibility is not None:
            _form_params += parse_form({'visibility': visibility})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_add_content_item_to_user_favourites_args(
        self,
        componentname: Annotated[Optional[StrictStr], Field(description="frankenstyle name of the component to which the content item belongs")],
        contentitemid: Annotated[StrictInt, Field(description="id of the content item")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Adds a content item (activity, resource or their subtypes) to the favourites for the user.

        Adds a content item (activity, resource or their subtypes) to the favourites for the user.

        :param componentname: frankenstyle name of the component to which the content item belongs (required)
        :type componentname: str
        :param contentitemid: id of the content item (required)
        :type contentitemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_add_content_item_to_user_favourites_serialize(
            componentname=componentname,
            contentitemid=contentitemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseAddContentItemToUserFavouritesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_add_content_item_to_user_favourites(
        self,
        componentname: Annotated[Optional[StrictStr], Field(description="frankenstyle name of the component to which the content item belongs")],
        contentitemid: Annotated[StrictInt, Field(description="id of the content item")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseAddContentItemToUserFavouritesResponse:
        """Adds a content item (activity, resource or their subtypes) to the favourites for the user.

        Adds a content item (activity, resource or their subtypes) to the favourites for the user.

        :param componentname: frankenstyle name of the component to which the content item belongs (required)
        :type componentname: str
        :param contentitemid: id of the content item (required)
        :type contentitemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_add_content_item_to_user_favourites_serialize(
            componentname=componentname,
            contentitemid=contentitemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseAddContentItemToUserFavouritesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_add_content_item_to_user_favourites_from_args(
        self,
        args
    ) -> CoreCourseAddContentItemToUserFavouritesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseAddContentItemToUserFavouritesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_add_content_item_to_user_favourites_with_http_info(
        self,
        componentname: Annotated[Optional[StrictStr], Field(description="frankenstyle name of the component to which the content item belongs")],
        contentitemid: Annotated[StrictInt, Field(description="id of the content item")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseAddContentItemToUserFavouritesResponse]:
        """Adds a content item (activity, resource or their subtypes) to the favourites for the user.

        Adds a content item (activity, resource or their subtypes) to the favourites for the user.

        :param componentname: frankenstyle name of the component to which the content item belongs (required)
        :type componentname: str
        :param contentitemid: id of the content item (required)
        :type contentitemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_add_content_item_to_user_favourites_serialize(
            componentname=componentname,
            contentitemid=contentitemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseAddContentItemToUserFavouritesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_add_content_item_to_user_favourites_without_preload_content(
        self,
        componentname: Annotated[Optional[StrictStr], Field(description="frankenstyle name of the component to which the content item belongs")],
        contentitemid: Annotated[StrictInt, Field(description="id of the content item")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Adds a content item (activity, resource or their subtypes) to the favourites for the user.

        Adds a content item (activity, resource or their subtypes) to the favourites for the user.

        :param componentname: frankenstyle name of the component to which the content item belongs (required)
        :type componentname: str
        :param contentitemid: id of the content item (required)
        :type contentitemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_add_content_item_to_user_favourites_serialize(
            componentname=componentname,
            contentitemid=contentitemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseAddContentItemToUserFavouritesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_add_content_item_to_user_favourites_serialize(
        self,
        componentname,
        contentitemid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_course_add_content_item_to_user_favourites'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_add_content_item_to_user_favourites'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_add_content_item_to_user_favourites',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if componentname is not None:
            _form_params += parse_form({'componentname': componentname})
        if contentitemid is not None:
            _form_params += parse_form({'contentitemid': contentitemid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_check_updates_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id to check")],
        tocheck: Annotated[List[CoreCourseCheckUpdatesParametersTocheckInner], Field(description="Instances to check")],
        filter: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Check only for updates in these areas")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Check if there is updates affecting the user for the given course and contexts.

        Check if there is updates affecting the user for the given course and contexts.

        :param courseid: Course id to check (required)
        :type courseid: int
        :param tocheck: Instances to check (required)
        :type tocheck: List[CoreCourseCheckUpdatesParametersTocheckInner]
        :param filter: Check only for updates in these areas
        :type filter: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_check_updates_serialize(
            courseid=courseid,
            tocheck=tocheck,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseCheckUpdatesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_check_updates(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id to check")],
        tocheck: Annotated[List[CoreCourseCheckUpdatesParametersTocheckInner], Field(description="Instances to check")],
        filter: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Check only for updates in these areas")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseCheckUpdatesResponse:
        """Check if there is updates affecting the user for the given course and contexts.

        Check if there is updates affecting the user for the given course and contexts.

        :param courseid: Course id to check (required)
        :type courseid: int
        :param tocheck: Instances to check (required)
        :type tocheck: List[CoreCourseCheckUpdatesParametersTocheckInner]
        :param filter: Check only for updates in these areas
        :type filter: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_check_updates_serialize(
            courseid=courseid,
            tocheck=tocheck,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseCheckUpdatesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_check_updates_from_args(
        self,
        args
    ) -> CoreCourseCheckUpdatesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseCheckUpdatesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_check_updates_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id to check")],
        tocheck: Annotated[List[CoreCourseCheckUpdatesParametersTocheckInner], Field(description="Instances to check")],
        filter: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Check only for updates in these areas")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseCheckUpdatesResponse]:
        """Check if there is updates affecting the user for the given course and contexts.

        Check if there is updates affecting the user for the given course and contexts.

        :param courseid: Course id to check (required)
        :type courseid: int
        :param tocheck: Instances to check (required)
        :type tocheck: List[CoreCourseCheckUpdatesParametersTocheckInner]
        :param filter: Check only for updates in these areas
        :type filter: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_check_updates_serialize(
            courseid=courseid,
            tocheck=tocheck,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseCheckUpdatesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_check_updates_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id to check")],
        tocheck: Annotated[List[CoreCourseCheckUpdatesParametersTocheckInner], Field(description="Instances to check")],
        filter: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Check only for updates in these areas")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Check if there is updates affecting the user for the given course and contexts.

        Check if there is updates affecting the user for the given course and contexts.

        :param courseid: Course id to check (required)
        :type courseid: int
        :param tocheck: Instances to check (required)
        :type tocheck: List[CoreCourseCheckUpdatesParametersTocheckInner]
        :param filter: Check only for updates in these areas
        :type filter: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_check_updates_serialize(
            courseid=courseid,
            tocheck=tocheck,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseCheckUpdatesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_check_updates_serialize(
        self,
        courseid,
        tocheck,
        filter,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'tocheck': 'csv',
            'filter': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_check_updates'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_check_updates'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_check_updates',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if filter is not None:
            _form_params += parse_form({'filter': filter})
        if tocheck is not None:
            _form_params += parse_form({'tocheck': tocheck})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_create_categories_args(
        self,
        categories: List[CoreCourseCreateCategoriesParametersCategoriesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Create course categories

        Create course categories

        :param categories: (required)
        :type categories: List[CoreCourseCreateCategoriesParametersCategoriesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_create_categories_serialize(
            categories=categories,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseCreateCategoriesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_create_categories(
        self,
        categories: List[CoreCourseCreateCategoriesParametersCategoriesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCourseCreateCategoriesResponseInner]:
        """Create course categories

        Create course categories

        :param categories: (required)
        :type categories: List[CoreCourseCreateCategoriesParametersCategoriesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_create_categories_serialize(
            categories=categories,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseCreateCategoriesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_create_categories_from_args(
        self,
        args
    ) -> List[CoreCourseCreateCategoriesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseCreateCategoriesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_create_categories_with_http_info(
        self,
        categories: List[CoreCourseCreateCategoriesParametersCategoriesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCourseCreateCategoriesResponseInner]]:
        """Create course categories

        Create course categories

        :param categories: (required)
        :type categories: List[CoreCourseCreateCategoriesParametersCategoriesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_create_categories_serialize(
            categories=categories,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseCreateCategoriesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_create_categories_without_preload_content(
        self,
        categories: List[CoreCourseCreateCategoriesParametersCategoriesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create course categories

        Create course categories

        :param categories: (required)
        :type categories: List[CoreCourseCreateCategoriesParametersCategoriesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_create_categories_serialize(
            categories=categories,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseCreateCategoriesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_create_categories_serialize(
        self,
        categories,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'categories': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_create_categories'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_create_categories'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_create_categories',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if categories is not None:
            _form_params += parse_form({'categories': categories})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_create_courses_args(
        self,
        courses: Annotated[List[CoreCourseCreateCoursesParametersCoursesInner], Field(description="courses to create")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Create new courses

        Create new courses

        :param courses: courses to create (required)
        :type courses: List[CoreCourseCreateCoursesParametersCoursesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_create_courses_serialize(
            courses=courses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseCreateCoursesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_create_courses(
        self,
        courses: Annotated[List[CoreCourseCreateCoursesParametersCoursesInner], Field(description="courses to create")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCourseCreateCoursesResponseInner]:
        """Create new courses

        Create new courses

        :param courses: courses to create (required)
        :type courses: List[CoreCourseCreateCoursesParametersCoursesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_create_courses_serialize(
            courses=courses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseCreateCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_create_courses_from_args(
        self,
        args
    ) -> List[CoreCourseCreateCoursesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseCreateCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_create_courses_with_http_info(
        self,
        courses: Annotated[List[CoreCourseCreateCoursesParametersCoursesInner], Field(description="courses to create")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCourseCreateCoursesResponseInner]]:
        """Create new courses

        Create new courses

        :param courses: courses to create (required)
        :type courses: List[CoreCourseCreateCoursesParametersCoursesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_create_courses_serialize(
            courses=courses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseCreateCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_create_courses_without_preload_content(
        self,
        courses: Annotated[List[CoreCourseCreateCoursesParametersCoursesInner], Field(description="courses to create")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create new courses

        Create new courses

        :param courses: courses to create (required)
        :type courses: List[CoreCourseCreateCoursesParametersCoursesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_create_courses_serialize(
            courses=courses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseCreateCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_create_courses_serialize(
        self,
        courses,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courses': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_create_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_create_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_create_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courses is not None:
            _form_params += parse_form({'courses': courses})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_delete_categories_args(
        self,
        categories: List[CoreCourseDeleteCategoriesParametersCategoriesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete course categories

        Delete course categories

        :param categories: (required)
        :type categories: List[CoreCourseDeleteCategoriesParametersCategoriesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_delete_categories_serialize(
            categories=categories,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_delete_categories(
        self,
        categories: List[CoreCourseDeleteCategoriesParametersCategoriesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Delete course categories

        Delete course categories

        :param categories: (required)
        :type categories: List[CoreCourseDeleteCategoriesParametersCategoriesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_delete_categories_serialize(
            categories=categories,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_delete_categories_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_delete_categories_with_http_info(
        self,
        categories: List[CoreCourseDeleteCategoriesParametersCategoriesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Delete course categories

        Delete course categories

        :param categories: (required)
        :type categories: List[CoreCourseDeleteCategoriesParametersCategoriesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_delete_categories_serialize(
            categories=categories,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_delete_categories_without_preload_content(
        self,
        categories: List[CoreCourseDeleteCategoriesParametersCategoriesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete course categories

        Delete course categories

        :param categories: (required)
        :type categories: List[CoreCourseDeleteCategoriesParametersCategoriesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_delete_categories_serialize(
            categories=categories,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_delete_categories_serialize(
        self,
        categories,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'categories': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_delete_categories'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_delete_categories'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_delete_categories',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if categories is not None:
            _form_params += parse_form({'categories': categories})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_delete_courses_args(
        self,
        courseids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes all specified courses

        Deletes all specified courses

        :param courseids: (required)
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_delete_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseDeleteCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_delete_courses(
        self,
        courseids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseDeleteCoursesResponse:
        """Deletes all specified courses

        Deletes all specified courses

        :param courseids: (required)
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_delete_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseDeleteCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_delete_courses_from_args(
        self,
        args
    ) -> CoreCourseDeleteCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseDeleteCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_delete_courses_with_http_info(
        self,
        courseids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseDeleteCoursesResponse]:
        """Deletes all specified courses

        Deletes all specified courses

        :param courseids: (required)
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_delete_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseDeleteCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_delete_courses_without_preload_content(
        self,
        courseids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes all specified courses

        Deletes all specified courses

        :param courseids: (required)
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_delete_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseDeleteCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_delete_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_delete_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_delete_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_delete_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_delete_modules_args(
        self,
        cmids: Annotated[List[StrictInt], Field(description="Array of course module IDs")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes all specified module instances

        Deletes all specified module instances

        :param cmids: Array of course module IDs (required)
        :type cmids: List[int]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_delete_modules_serialize(
            cmids=cmids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_delete_modules(
        self,
        cmids: Annotated[List[StrictInt], Field(description="Array of course module IDs")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Deletes all specified module instances

        Deletes all specified module instances

        :param cmids: Array of course module IDs (required)
        :type cmids: List[int]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_delete_modules_serialize(
            cmids=cmids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_delete_modules_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_delete_modules_with_http_info(
        self,
        cmids: Annotated[List[StrictInt], Field(description="Array of course module IDs")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Deletes all specified module instances

        Deletes all specified module instances

        :param cmids: Array of course module IDs (required)
        :type cmids: List[int]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_delete_modules_serialize(
            cmids=cmids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_delete_modules_without_preload_content(
        self,
        cmids: Annotated[List[StrictInt], Field(description="Array of course module IDs")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes all specified module instances

        Deletes all specified module instances

        :param cmids: Array of course module IDs (required)
        :type cmids: List[int]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_delete_modules_serialize(
            cmids=cmids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_delete_modules_serialize(
        self,
        cmids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'cmids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_delete_modules'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_delete_modules'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_delete_modules',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmids is not None:
            _form_params += parse_form({'cmids': cmids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_duplicate_course_args(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="duplicated course category parent")],
        courseid: Annotated[Optional[StrictInt], Field(description="course to duplicate id")],
        fullname: Annotated[Optional[StrictStr], Field(description="duplicated course full name")],
        shortname: Annotated[Optional[StrictStr], Field(description="duplicated course short name")],
        options: Annotated[Optional[List[CoreCourseDuplicateCourseParametersOptionsInner]], Field(description="Course duplication options")] = None,
        visible: Annotated[Optional[StrictInt], Field(description="duplicated course visible, default to yes")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Duplicate an existing course (creating a new one).

        Duplicate an existing course (creating a new one).

        :param categoryid: duplicated course category parent (required)
        :type categoryid: int
        :param courseid: course to duplicate id (required)
        :type courseid: int
        :param fullname: duplicated course full name (required)
        :type fullname: str
        :param shortname: duplicated course short name (required)
        :type shortname: str
        :param options: Course duplication options
        :type options: List[CoreCourseDuplicateCourseParametersOptionsInner]
        :param visible: duplicated course visible, default to yes
        :type visible: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_duplicate_course_serialize(
            categoryid=categoryid,
            courseid=courseid,
            fullname=fullname,
            shortname=shortname,
            options=options,
            visible=visible,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseDuplicateCourseResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_duplicate_course(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="duplicated course category parent")],
        courseid: Annotated[Optional[StrictInt], Field(description="course to duplicate id")],
        fullname: Annotated[Optional[StrictStr], Field(description="duplicated course full name")],
        shortname: Annotated[Optional[StrictStr], Field(description="duplicated course short name")],
        options: Annotated[Optional[List[CoreCourseDuplicateCourseParametersOptionsInner]], Field(description="Course duplication options")] = None,
        visible: Annotated[Optional[StrictInt], Field(description="duplicated course visible, default to yes")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseDuplicateCourseResponse:
        """Duplicate an existing course (creating a new one).

        Duplicate an existing course (creating a new one).

        :param categoryid: duplicated course category parent (required)
        :type categoryid: int
        :param courseid: course to duplicate id (required)
        :type courseid: int
        :param fullname: duplicated course full name (required)
        :type fullname: str
        :param shortname: duplicated course short name (required)
        :type shortname: str
        :param options: Course duplication options
        :type options: List[CoreCourseDuplicateCourseParametersOptionsInner]
        :param visible: duplicated course visible, default to yes
        :type visible: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_duplicate_course_serialize(
            categoryid=categoryid,
            courseid=courseid,
            fullname=fullname,
            shortname=shortname,
            options=options,
            visible=visible,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseDuplicateCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_duplicate_course_from_args(
        self,
        args
    ) -> CoreCourseDuplicateCourseResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseDuplicateCourseResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_duplicate_course_with_http_info(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="duplicated course category parent")],
        courseid: Annotated[Optional[StrictInt], Field(description="course to duplicate id")],
        fullname: Annotated[Optional[StrictStr], Field(description="duplicated course full name")],
        shortname: Annotated[Optional[StrictStr], Field(description="duplicated course short name")],
        options: Annotated[Optional[List[CoreCourseDuplicateCourseParametersOptionsInner]], Field(description="Course duplication options")] = None,
        visible: Annotated[Optional[StrictInt], Field(description="duplicated course visible, default to yes")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseDuplicateCourseResponse]:
        """Duplicate an existing course (creating a new one).

        Duplicate an existing course (creating a new one).

        :param categoryid: duplicated course category parent (required)
        :type categoryid: int
        :param courseid: course to duplicate id (required)
        :type courseid: int
        :param fullname: duplicated course full name (required)
        :type fullname: str
        :param shortname: duplicated course short name (required)
        :type shortname: str
        :param options: Course duplication options
        :type options: List[CoreCourseDuplicateCourseParametersOptionsInner]
        :param visible: duplicated course visible, default to yes
        :type visible: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_duplicate_course_serialize(
            categoryid=categoryid,
            courseid=courseid,
            fullname=fullname,
            shortname=shortname,
            options=options,
            visible=visible,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseDuplicateCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_duplicate_course_without_preload_content(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="duplicated course category parent")],
        courseid: Annotated[Optional[StrictInt], Field(description="course to duplicate id")],
        fullname: Annotated[Optional[StrictStr], Field(description="duplicated course full name")],
        shortname: Annotated[Optional[StrictStr], Field(description="duplicated course short name")],
        options: Annotated[Optional[List[CoreCourseDuplicateCourseParametersOptionsInner]], Field(description="Course duplication options")] = None,
        visible: Annotated[Optional[StrictInt], Field(description="duplicated course visible, default to yes")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Duplicate an existing course (creating a new one).

        Duplicate an existing course (creating a new one).

        :param categoryid: duplicated course category parent (required)
        :type categoryid: int
        :param courseid: course to duplicate id (required)
        :type courseid: int
        :param fullname: duplicated course full name (required)
        :type fullname: str
        :param shortname: duplicated course short name (required)
        :type shortname: str
        :param options: Course duplication options
        :type options: List[CoreCourseDuplicateCourseParametersOptionsInner]
        :param visible: duplicated course visible, default to yes
        :type visible: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_duplicate_course_serialize(
            categoryid=categoryid,
            courseid=courseid,
            fullname=fullname,
            shortname=shortname,
            options=options,
            visible=visible,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseDuplicateCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_duplicate_course_serialize(
        self,
        categoryid,
        courseid,
        fullname,
        shortname,
        options,
        visible,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'options': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_duplicate_course'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_duplicate_course'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_duplicate_course',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if categoryid is not None:
            _form_params += parse_form({'categoryid': categoryid})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if fullname is not None:
            _form_params += parse_form({'fullname': fullname})
        if options is not None:
            _form_params += parse_form({'options': options})
        if shortname is not None:
            _form_params += parse_form({'shortname': shortname})
        if visible is not None:
            _form_params += parse_form({'visible': visible})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_edit_module_args(
        self,
        action: Annotated[Optional[StrictStr], Field(description="action: hide, show, stealth, duplicate, delete, moveleft, moveright, group...")],
        id: Annotated[Optional[StrictInt], Field(description="course module id")],
        sectionreturn: Annotated[Optional[StrictInt], Field(description="section to return to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0). Performs an action on course module (change visibility, duplicate, delete, etc.) Use core_courseformat_update_course instead.

        ** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0). Performs an action on course module (change visibility, duplicate, delete, etc.) Use core_courseformat_update_course instead.

        :param action: action: hide, show, stealth, duplicate, delete, moveleft, moveright, group... (required)
        :type action: str
        :param id: course module id (required)
        :type id: int
        :param sectionreturn: section to return to
        :type sectionreturn: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_edit_module_serialize(
            action=action,
            id=id,
            sectionreturn=sectionreturn,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_edit_module(
        self,
        action: Annotated[Optional[StrictStr], Field(description="action: hide, show, stealth, duplicate, delete, moveleft, moveright, group...")],
        id: Annotated[Optional[StrictInt], Field(description="course module id")],
        sectionreturn: Annotated[Optional[StrictInt], Field(description="section to return to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0). Performs an action on course module (change visibility, duplicate, delete, etc.) Use core_courseformat_update_course instead.

        ** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0). Performs an action on course module (change visibility, duplicate, delete, etc.) Use core_courseformat_update_course instead.

        :param action: action: hide, show, stealth, duplicate, delete, moveleft, moveright, group... (required)
        :type action: str
        :param id: course module id (required)
        :type id: int
        :param sectionreturn: section to return to
        :type sectionreturn: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_edit_module_serialize(
            action=action,
            id=id,
            sectionreturn=sectionreturn,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_edit_module_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_edit_module_with_http_info(
        self,
        action: Annotated[Optional[StrictStr], Field(description="action: hide, show, stealth, duplicate, delete, moveleft, moveright, group...")],
        id: Annotated[Optional[StrictInt], Field(description="course module id")],
        sectionreturn: Annotated[Optional[StrictInt], Field(description="section to return to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0). Performs an action on course module (change visibility, duplicate, delete, etc.) Use core_courseformat_update_course instead.

        ** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0). Performs an action on course module (change visibility, duplicate, delete, etc.) Use core_courseformat_update_course instead.

        :param action: action: hide, show, stealth, duplicate, delete, moveleft, moveright, group... (required)
        :type action: str
        :param id: course module id (required)
        :type id: int
        :param sectionreturn: section to return to
        :type sectionreturn: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_edit_module_serialize(
            action=action,
            id=id,
            sectionreturn=sectionreturn,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_edit_module_without_preload_content(
        self,
        action: Annotated[Optional[StrictStr], Field(description="action: hide, show, stealth, duplicate, delete, moveleft, moveright, group...")],
        id: Annotated[Optional[StrictInt], Field(description="course module id")],
        sectionreturn: Annotated[Optional[StrictInt], Field(description="section to return to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0). Performs an action on course module (change visibility, duplicate, delete, etc.) Use core_courseformat_update_course instead.

        ** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0). Performs an action on course module (change visibility, duplicate, delete, etc.) Use core_courseformat_update_course instead.

        :param action: action: hide, show, stealth, duplicate, delete, moveleft, moveright, group... (required)
        :type action: str
        :param id: course module id (required)
        :type id: int
        :param sectionreturn: section to return to
        :type sectionreturn: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_edit_module_serialize(
            action=action,
            id=id,
            sectionreturn=sectionreturn,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_edit_module_serialize(
        self,
        action,
        id,
        sectionreturn,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_course_edit_module'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_edit_module'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_edit_module',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if action is not None:
            _form_params += parse_form({'action': action})
        if id is not None:
            _form_params += parse_form({'id': id})
        if sectionreturn is not None:
            _form_params += parse_form({'sectionreturn': sectionreturn})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_edit_section_args(
        self,
        action: Annotated[Optional[StrictStr], Field(description="action: hide, show, stealth, setmarker, removemarker")],
        id: Annotated[Optional[StrictInt], Field(description="course section id")],
        sectionreturn: Annotated[Optional[StrictInt], Field(description="section to return to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).Performs an action on course section (change visibility, set marker, delete) Use core_courseformat_update_course instead.

        ** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).Performs an action on course section (change visibility, set marker, delete) Use core_courseformat_update_course instead.

        :param action: action: hide, show, stealth, setmarker, removemarker (required)
        :type action: str
        :param id: course section id (required)
        :type id: int
        :param sectionreturn: section to return to
        :type sectionreturn: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_edit_section_serialize(
            action=action,
            id=id,
            sectionreturn=sectionreturn,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_edit_section(
        self,
        action: Annotated[Optional[StrictStr], Field(description="action: hide, show, stealth, setmarker, removemarker")],
        id: Annotated[Optional[StrictInt], Field(description="course section id")],
        sectionreturn: Annotated[Optional[StrictInt], Field(description="section to return to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).Performs an action on course section (change visibility, set marker, delete) Use core_courseformat_update_course instead.

        ** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).Performs an action on course section (change visibility, set marker, delete) Use core_courseformat_update_course instead.

        :param action: action: hide, show, stealth, setmarker, removemarker (required)
        :type action: str
        :param id: course section id (required)
        :type id: int
        :param sectionreturn: section to return to
        :type sectionreturn: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_edit_section_serialize(
            action=action,
            id=id,
            sectionreturn=sectionreturn,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_edit_section_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_edit_section_with_http_info(
        self,
        action: Annotated[Optional[StrictStr], Field(description="action: hide, show, stealth, setmarker, removemarker")],
        id: Annotated[Optional[StrictInt], Field(description="course section id")],
        sectionreturn: Annotated[Optional[StrictInt], Field(description="section to return to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).Performs an action on course section (change visibility, set marker, delete) Use core_courseformat_update_course instead.

        ** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).Performs an action on course section (change visibility, set marker, delete) Use core_courseformat_update_course instead.

        :param action: action: hide, show, stealth, setmarker, removemarker (required)
        :type action: str
        :param id: course section id (required)
        :type id: int
        :param sectionreturn: section to return to
        :type sectionreturn: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_edit_section_serialize(
            action=action,
            id=id,
            sectionreturn=sectionreturn,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_edit_section_without_preload_content(
        self,
        action: Annotated[Optional[StrictStr], Field(description="action: hide, show, stealth, setmarker, removemarker")],
        id: Annotated[Optional[StrictInt], Field(description="course section id")],
        sectionreturn: Annotated[Optional[StrictInt], Field(description="section to return to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).Performs an action on course section (change visibility, set marker, delete) Use core_courseformat_update_course instead.

        ** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).Performs an action on course section (change visibility, set marker, delete) Use core_courseformat_update_course instead.

        :param action: action: hide, show, stealth, setmarker, removemarker (required)
        :type action: str
        :param id: course section id (required)
        :type id: int
        :param sectionreturn: section to return to
        :type sectionreturn: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_edit_section_serialize(
            action=action,
            id=id,
            sectionreturn=sectionreturn,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_edit_section_serialize(
        self,
        action,
        id,
        sectionreturn,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_course_edit_section'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_edit_section'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_edit_section',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if action is not None:
            _form_params += parse_form({'action': action})
        if id is not None:
            _form_params += parse_form({'id': id})
        if sectionreturn is not None:
            _form_params += parse_form({'sectionreturn': sectionreturn})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_get_activity_chooser_footer_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="ID of the course")],
        sectionid: Annotated[Optional[StrictInt], Field(description="ID of the section")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetch the data for the activity chooser footer.

        Fetch the data for the activity chooser footer.

        :param courseid: ID of the course (required)
        :type courseid: int
        :param sectionid: ID of the section (required)
        :type sectionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_activity_chooser_footer_serialize(
            courseid=courseid,
            sectionid=sectionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetActivityChooserFooterResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_get_activity_chooser_footer(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="ID of the course")],
        sectionid: Annotated[Optional[StrictInt], Field(description="ID of the section")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseGetActivityChooserFooterResponse:
        """Fetch the data for the activity chooser footer.

        Fetch the data for the activity chooser footer.

        :param courseid: ID of the course (required)
        :type courseid: int
        :param sectionid: ID of the section (required)
        :type sectionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_activity_chooser_footer_serialize(
            courseid=courseid,
            sectionid=sectionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetActivityChooserFooterResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_activity_chooser_footer_from_args(
        self,
        args
    ) -> CoreCourseGetActivityChooserFooterResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetActivityChooserFooterResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_activity_chooser_footer_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="ID of the course")],
        sectionid: Annotated[Optional[StrictInt], Field(description="ID of the section")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseGetActivityChooserFooterResponse]:
        """Fetch the data for the activity chooser footer.

        Fetch the data for the activity chooser footer.

        :param courseid: ID of the course (required)
        :type courseid: int
        :param sectionid: ID of the section (required)
        :type sectionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_activity_chooser_footer_serialize(
            courseid=courseid,
            sectionid=sectionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetActivityChooserFooterResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_get_activity_chooser_footer_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="ID of the course")],
        sectionid: Annotated[Optional[StrictInt], Field(description="ID of the section")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetch the data for the activity chooser footer.

        Fetch the data for the activity chooser footer.

        :param courseid: ID of the course (required)
        :type courseid: int
        :param sectionid: ID of the section (required)
        :type sectionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_activity_chooser_footer_serialize(
            courseid=courseid,
            sectionid=sectionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetActivityChooserFooterResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_get_activity_chooser_footer_serialize(
        self,
        courseid,
        sectionid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_course_get_activity_chooser_footer'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_get_activity_chooser_footer'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_get_activity_chooser_footer',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if sectionid is not None:
            _form_params += parse_form({'sectionid': sectionid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_get_categories_args(
        self,
        addsubcategories: Annotated[Optional[StrictBool], Field(description="return the sub categories infos                                           (1 - default) otherwise only the category info (0)")] = None,
        criteria: Annotated[Optional[List[CoreCourseGetCategoriesParametersCriteriaInner]], Field(description="criteria")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return category details

        Return category details

        :param addsubcategories: return the sub categories infos                                           (1 - default) otherwise only the category info (0)
        :type addsubcategories: bool
        :param criteria: criteria
        :type criteria: List[CoreCourseGetCategoriesParametersCriteriaInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_categories_serialize(
            addsubcategories=addsubcategories,
            criteria=criteria,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseGetCategoriesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_get_categories(
        self,
        addsubcategories: Annotated[Optional[StrictBool], Field(description="return the sub categories infos                                           (1 - default) otherwise only the category info (0)")] = None,
        criteria: Annotated[Optional[List[CoreCourseGetCategoriesParametersCriteriaInner]], Field(description="criteria")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCourseGetCategoriesResponseInner]:
        """Return category details

        Return category details

        :param addsubcategories: return the sub categories infos                                           (1 - default) otherwise only the category info (0)
        :type addsubcategories: bool
        :param criteria: criteria
        :type criteria: List[CoreCourseGetCategoriesParametersCriteriaInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_categories_serialize(
            addsubcategories=addsubcategories,
            criteria=criteria,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseGetCategoriesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_categories_from_args(
        self,
        args
    ) -> List[CoreCourseGetCategoriesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseGetCategoriesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_categories_with_http_info(
        self,
        addsubcategories: Annotated[Optional[StrictBool], Field(description="return the sub categories infos                                           (1 - default) otherwise only the category info (0)")] = None,
        criteria: Annotated[Optional[List[CoreCourseGetCategoriesParametersCriteriaInner]], Field(description="criteria")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCourseGetCategoriesResponseInner]]:
        """Return category details

        Return category details

        :param addsubcategories: return the sub categories infos                                           (1 - default) otherwise only the category info (0)
        :type addsubcategories: bool
        :param criteria: criteria
        :type criteria: List[CoreCourseGetCategoriesParametersCriteriaInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_categories_serialize(
            addsubcategories=addsubcategories,
            criteria=criteria,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseGetCategoriesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_get_categories_without_preload_content(
        self,
        addsubcategories: Annotated[Optional[StrictBool], Field(description="return the sub categories infos                                           (1 - default) otherwise only the category info (0)")] = None,
        criteria: Annotated[Optional[List[CoreCourseGetCategoriesParametersCriteriaInner]], Field(description="criteria")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return category details

        Return category details

        :param addsubcategories: return the sub categories infos                                           (1 - default) otherwise only the category info (0)
        :type addsubcategories: bool
        :param criteria: criteria
        :type criteria: List[CoreCourseGetCategoriesParametersCriteriaInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_categories_serialize(
            addsubcategories=addsubcategories,
            criteria=criteria,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseGetCategoriesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_get_categories_serialize(
        self,
        addsubcategories,
        criteria,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'criteria': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_get_categories'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_get_categories'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_get_categories',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if addsubcategories is not None:
            _form_params += parse_form({'addsubcategories': addsubcategories})
        if criteria is not None:
            _form_params += parse_form({'criteria': criteria})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_get_contents_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        options: Annotated[Optional[List[CoreCourseGetContentsParametersOptionsInner]], Field(description="Options, used since Moodle 2.9")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get course contents

        Get course contents

        :param courseid: course id (required)
        :type courseid: int
        :param options: Options, used since Moodle 2.9
        :type options: List[CoreCourseGetContentsParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_contents_serialize(
            courseid=courseid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseGetContentsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_get_contents(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        options: Annotated[Optional[List[CoreCourseGetContentsParametersOptionsInner]], Field(description="Options, used since Moodle 2.9")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCourseGetContentsResponseInner]:
        """Get course contents

        Get course contents

        :param courseid: course id (required)
        :type courseid: int
        :param options: Options, used since Moodle 2.9
        :type options: List[CoreCourseGetContentsParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_contents_serialize(
            courseid=courseid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseGetContentsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_contents_from_args(
        self,
        args
    ) -> List[CoreCourseGetContentsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseGetContentsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_contents_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        options: Annotated[Optional[List[CoreCourseGetContentsParametersOptionsInner]], Field(description="Options, used since Moodle 2.9")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCourseGetContentsResponseInner]]:
        """Get course contents

        Get course contents

        :param courseid: course id (required)
        :type courseid: int
        :param options: Options, used since Moodle 2.9
        :type options: List[CoreCourseGetContentsParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_contents_serialize(
            courseid=courseid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseGetContentsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_get_contents_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        options: Annotated[Optional[List[CoreCourseGetContentsParametersOptionsInner]], Field(description="Options, used since Moodle 2.9")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get course contents

        Get course contents

        :param courseid: course id (required)
        :type courseid: int
        :param options: Options, used since Moodle 2.9
        :type options: List[CoreCourseGetContentsParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_contents_serialize(
            courseid=courseid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseGetContentsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_get_contents_serialize(
        self,
        courseid,
        options,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'options': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_get_contents'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_get_contents'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_get_contents',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if options is not None:
            _form_params += parse_form({'options': options})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_get_course_content_items_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="ID of the course")],
        sectionnum: Annotated[Optional[StrictInt], Field(description="Number of the section")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetch all the content items (activities, resources and their subtypes) for the activity picker

        Fetch all the content items (activities, resources and their subtypes) for the activity picker

        :param courseid: ID of the course (required)
        :type courseid: int
        :param sectionnum: Number of the section
        :type sectionnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_course_content_items_serialize(
            courseid=courseid,
            sectionnum=sectionnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCourseContentItemsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_get_course_content_items(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="ID of the course")],
        sectionnum: Annotated[Optional[StrictInt], Field(description="Number of the section")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseGetCourseContentItemsResponse:
        """Fetch all the content items (activities, resources and their subtypes) for the activity picker

        Fetch all the content items (activities, resources and their subtypes) for the activity picker

        :param courseid: ID of the course (required)
        :type courseid: int
        :param sectionnum: Number of the section
        :type sectionnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_course_content_items_serialize(
            courseid=courseid,
            sectionnum=sectionnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCourseContentItemsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_course_content_items_from_args(
        self,
        args
    ) -> CoreCourseGetCourseContentItemsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCourseContentItemsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_course_content_items_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="ID of the course")],
        sectionnum: Annotated[Optional[StrictInt], Field(description="Number of the section")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseGetCourseContentItemsResponse]:
        """Fetch all the content items (activities, resources and their subtypes) for the activity picker

        Fetch all the content items (activities, resources and their subtypes) for the activity picker

        :param courseid: ID of the course (required)
        :type courseid: int
        :param sectionnum: Number of the section
        :type sectionnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_course_content_items_serialize(
            courseid=courseid,
            sectionnum=sectionnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCourseContentItemsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_get_course_content_items_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="ID of the course")],
        sectionnum: Annotated[Optional[StrictInt], Field(description="Number of the section")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetch all the content items (activities, resources and their subtypes) for the activity picker

        Fetch all the content items (activities, resources and their subtypes) for the activity picker

        :param courseid: ID of the course (required)
        :type courseid: int
        :param sectionnum: Number of the section
        :type sectionnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_course_content_items_serialize(
            courseid=courseid,
            sectionnum=sectionnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCourseContentItemsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_get_course_content_items_serialize(
        self,
        courseid,
        sectionnum,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_course_get_course_content_items'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_get_course_content_items'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_get_course_content_items',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if sectionnum is not None:
            _form_params += parse_form({'sectionnum': sectionnum})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_get_course_module_args(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The course module id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return information about a course module

        Return information about a course module

        :param cmid: The course module id (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_course_module_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCourseModuleResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_get_course_module(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The course module id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseGetCourseModuleResponse:
        """Return information about a course module

        Return information about a course module

        :param cmid: The course module id (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_course_module_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCourseModuleResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_course_module_from_args(
        self,
        args
    ) -> CoreCourseGetCourseModuleResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCourseModuleResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_course_module_with_http_info(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The course module id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseGetCourseModuleResponse]:
        """Return information about a course module

        Return information about a course module

        :param cmid: The course module id (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_course_module_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCourseModuleResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_get_course_module_without_preload_content(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The course module id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return information about a course module

        Return information about a course module

        :param cmid: The course module id (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_course_module_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCourseModuleResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_get_course_module_serialize(
        self,
        cmid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_course_get_course_module'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_get_course_module'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_get_course_module',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_get_course_module_by_instance_args(
        self,
        instance: Annotated[Optional[StrictInt], Field(description="The module instance id")],
        module: Annotated[Optional[StrictStr], Field(description="The module name")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return information about a given module name and instance id

        Return information about a given module name and instance id

        :param instance: The module instance id (required)
        :type instance: int
        :param module: The module name (required)
        :type module: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_course_module_by_instance_serialize(
            instance=instance,
            module=module,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCourseModuleByInstanceResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_get_course_module_by_instance(
        self,
        instance: Annotated[Optional[StrictInt], Field(description="The module instance id")],
        module: Annotated[Optional[StrictStr], Field(description="The module name")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseGetCourseModuleByInstanceResponse:
        """Return information about a given module name and instance id

        Return information about a given module name and instance id

        :param instance: The module instance id (required)
        :type instance: int
        :param module: The module name (required)
        :type module: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_course_module_by_instance_serialize(
            instance=instance,
            module=module,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCourseModuleByInstanceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_course_module_by_instance_from_args(
        self,
        args
    ) -> CoreCourseGetCourseModuleByInstanceResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCourseModuleByInstanceResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_course_module_by_instance_with_http_info(
        self,
        instance: Annotated[Optional[StrictInt], Field(description="The module instance id")],
        module: Annotated[Optional[StrictStr], Field(description="The module name")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseGetCourseModuleByInstanceResponse]:
        """Return information about a given module name and instance id

        Return information about a given module name and instance id

        :param instance: The module instance id (required)
        :type instance: int
        :param module: The module name (required)
        :type module: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_course_module_by_instance_serialize(
            instance=instance,
            module=module,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCourseModuleByInstanceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_get_course_module_by_instance_without_preload_content(
        self,
        instance: Annotated[Optional[StrictInt], Field(description="The module instance id")],
        module: Annotated[Optional[StrictStr], Field(description="The module name")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return information about a given module name and instance id

        Return information about a given module name and instance id

        :param instance: The module instance id (required)
        :type instance: int
        :param module: The module name (required)
        :type module: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_course_module_by_instance_serialize(
            instance=instance,
            module=module,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCourseModuleByInstanceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_get_course_module_by_instance_serialize(
        self,
        instance,
        module,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_course_get_course_module_by_instance'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_get_course_module_by_instance'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_get_course_module_by_instance',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if instance is not None:
            _form_params += parse_form({'instance': instance})
        if module is not None:
            _form_params += parse_form({'module': module})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_get_courses_args(
        self,
        options: Optional[CoreCourseGetCoursesParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return course details

        Return course details

        :param options:
        :type options: CoreCourseGetCoursesParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_courses_serialize(
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseGetCoursesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_get_courses(
        self,
        options: Optional[CoreCourseGetCoursesParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCourseGetCoursesResponseInner]:
        """Return course details

        Return course details

        :param options:
        :type options: CoreCourseGetCoursesParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_courses_serialize(
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseGetCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_courses_from_args(
        self,
        args
    ) -> List[CoreCourseGetCoursesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseGetCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_courses_with_http_info(
        self,
        options: Optional[CoreCourseGetCoursesParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCourseGetCoursesResponseInner]]:
        """Return course details

        Return course details

        :param options:
        :type options: CoreCourseGetCoursesParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_courses_serialize(
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseGetCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_get_courses_without_preload_content(
        self,
        options: Optional[CoreCourseGetCoursesParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return course details

        Return course details

        :param options:
        :type options: CoreCourseGetCoursesParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_courses_serialize(
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseGetCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_get_courses_serialize(
        self,
        options,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_course_get_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_get_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_get_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if options is not None:
            _form_params += parse_form({'options': options})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_get_courses_by_field_args(
        self,
        var_field: Annotated[Optional[StrictStr], Field(description="The field to search can be left empty for all courses or:                     id: course id                     ids: comma separated course ids                     shortname: course short name                     idnumber: course id number                     category: category id the course belongs to                     sectionid: section id that belongs to a course                 ")] = None,
        value: Annotated[Optional[StrictStr], Field(description="The value to match")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get courses matching a specific field (id/s, shortname, idnumber, category)

        Get courses matching a specific field (id/s, shortname, idnumber, category)

        :param var_field: The field to search can be left empty for all courses or:                     id: course id                     ids: comma separated course ids                     shortname: course short name                     idnumber: course id number                     category: category id the course belongs to                     sectionid: section id that belongs to a course                 
        :type var_field: str
        :param value: The value to match
        :type value: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_courses_by_field_serialize(
            var_field=var_field,
            value=value,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCoursesByFieldResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_get_courses_by_field(
        self,
        var_field: Annotated[Optional[StrictStr], Field(description="The field to search can be left empty for all courses or:                     id: course id                     ids: comma separated course ids                     shortname: course short name                     idnumber: course id number                     category: category id the course belongs to                     sectionid: section id that belongs to a course                 ")] = None,
        value: Annotated[Optional[StrictStr], Field(description="The value to match")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseGetCoursesByFieldResponse:
        """Get courses matching a specific field (id/s, shortname, idnumber, category)

        Get courses matching a specific field (id/s, shortname, idnumber, category)

        :param var_field: The field to search can be left empty for all courses or:                     id: course id                     ids: comma separated course ids                     shortname: course short name                     idnumber: course id number                     category: category id the course belongs to                     sectionid: section id that belongs to a course                 
        :type var_field: str
        :param value: The value to match
        :type value: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_courses_by_field_serialize(
            var_field=var_field,
            value=value,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCoursesByFieldResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_courses_by_field_from_args(
        self,
        args
    ) -> CoreCourseGetCoursesByFieldResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCoursesByFieldResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_courses_by_field_with_http_info(
        self,
        var_field: Annotated[Optional[StrictStr], Field(description="The field to search can be left empty for all courses or:                     id: course id                     ids: comma separated course ids                     shortname: course short name                     idnumber: course id number                     category: category id the course belongs to                     sectionid: section id that belongs to a course                 ")] = None,
        value: Annotated[Optional[StrictStr], Field(description="The value to match")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseGetCoursesByFieldResponse]:
        """Get courses matching a specific field (id/s, shortname, idnumber, category)

        Get courses matching a specific field (id/s, shortname, idnumber, category)

        :param var_field: The field to search can be left empty for all courses or:                     id: course id                     ids: comma separated course ids                     shortname: course short name                     idnumber: course id number                     category: category id the course belongs to                     sectionid: section id that belongs to a course                 
        :type var_field: str
        :param value: The value to match
        :type value: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_courses_by_field_serialize(
            var_field=var_field,
            value=value,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCoursesByFieldResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_get_courses_by_field_without_preload_content(
        self,
        var_field: Annotated[Optional[StrictStr], Field(description="The field to search can be left empty for all courses or:                     id: course id                     ids: comma separated course ids                     shortname: course short name                     idnumber: course id number                     category: category id the course belongs to                     sectionid: section id that belongs to a course                 ")] = None,
        value: Annotated[Optional[StrictStr], Field(description="The value to match")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get courses matching a specific field (id/s, shortname, idnumber, category)

        Get courses matching a specific field (id/s, shortname, idnumber, category)

        :param var_field: The field to search can be left empty for all courses or:                     id: course id                     ids: comma separated course ids                     shortname: course short name                     idnumber: course id number                     category: category id the course belongs to                     sectionid: section id that belongs to a course                 
        :type var_field: str
        :param value: The value to match
        :type value: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_courses_by_field_serialize(
            var_field=var_field,
            value=value,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetCoursesByFieldResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_get_courses_by_field_serialize(
        self,
        var_field,
        value,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_course_get_courses_by_field'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_get_courses_by_field'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_get_courses_by_field',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if var_field is not None:
            _form_params += parse_form({'field': var_field})
        if value is not None:
            _form_params += parse_form({'value': value})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_get_enrolled_courses_by_timeline_classification_args(
        self,
        classification: Annotated[Optional[StrictStr], Field(description="future, inprogress, or past")],
        customfieldname: Annotated[Optional[StrictStr], Field(description="Used when classification = customfield")] = None,
        customfieldvalue: Annotated[Optional[StrictStr], Field(description="Used when classification = customfield")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Result set limit")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Result set offset")] = None,
        requiredfields: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Array of the only field names that need to be returned. If empty, all fields will be returned.")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort string")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """List of enrolled courses for the given timeline classification (past, inprogress, or future).

        List of enrolled courses for the given timeline classification (past, inprogress, or future).

        :param classification: future, inprogress, or past (required)
        :type classification: str
        :param customfieldname: Used when classification = customfield
        :type customfieldname: str
        :param customfieldvalue: Used when classification = customfield
        :type customfieldvalue: str
        :param limit: Result set limit
        :type limit: int
        :param offset: Result set offset
        :type offset: int
        :param requiredfields: Array of the only field names that need to be returned. If empty, all fields will be returned.
        :type requiredfields: List[Optional[str]]
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param sort: Sort string
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_enrolled_courses_by_timeline_classification_serialize(
            classification=classification,
            customfieldname=customfieldname,
            customfieldvalue=customfieldvalue,
            limit=limit,
            offset=offset,
            requiredfields=requiredfields,
            searchvalue=searchvalue,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetEnrolledCoursesByTimelineClassificationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_get_enrolled_courses_by_timeline_classification(
        self,
        classification: Annotated[Optional[StrictStr], Field(description="future, inprogress, or past")],
        customfieldname: Annotated[Optional[StrictStr], Field(description="Used when classification = customfield")] = None,
        customfieldvalue: Annotated[Optional[StrictStr], Field(description="Used when classification = customfield")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Result set limit")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Result set offset")] = None,
        requiredfields: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Array of the only field names that need to be returned. If empty, all fields will be returned.")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort string")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseGetEnrolledCoursesByTimelineClassificationResponse:
        """List of enrolled courses for the given timeline classification (past, inprogress, or future).

        List of enrolled courses for the given timeline classification (past, inprogress, or future).

        :param classification: future, inprogress, or past (required)
        :type classification: str
        :param customfieldname: Used when classification = customfield
        :type customfieldname: str
        :param customfieldvalue: Used when classification = customfield
        :type customfieldvalue: str
        :param limit: Result set limit
        :type limit: int
        :param offset: Result set offset
        :type offset: int
        :param requiredfields: Array of the only field names that need to be returned. If empty, all fields will be returned.
        :type requiredfields: List[Optional[str]]
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param sort: Sort string
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_enrolled_courses_by_timeline_classification_serialize(
            classification=classification,
            customfieldname=customfieldname,
            customfieldvalue=customfieldvalue,
            limit=limit,
            offset=offset,
            requiredfields=requiredfields,
            searchvalue=searchvalue,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetEnrolledCoursesByTimelineClassificationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_enrolled_courses_by_timeline_classification_from_args(
        self,
        args
    ) -> CoreCourseGetEnrolledCoursesByTimelineClassificationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetEnrolledCoursesByTimelineClassificationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_enrolled_courses_by_timeline_classification_with_http_info(
        self,
        classification: Annotated[Optional[StrictStr], Field(description="future, inprogress, or past")],
        customfieldname: Annotated[Optional[StrictStr], Field(description="Used when classification = customfield")] = None,
        customfieldvalue: Annotated[Optional[StrictStr], Field(description="Used when classification = customfield")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Result set limit")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Result set offset")] = None,
        requiredfields: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Array of the only field names that need to be returned. If empty, all fields will be returned.")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort string")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseGetEnrolledCoursesByTimelineClassificationResponse]:
        """List of enrolled courses for the given timeline classification (past, inprogress, or future).

        List of enrolled courses for the given timeline classification (past, inprogress, or future).

        :param classification: future, inprogress, or past (required)
        :type classification: str
        :param customfieldname: Used when classification = customfield
        :type customfieldname: str
        :param customfieldvalue: Used when classification = customfield
        :type customfieldvalue: str
        :param limit: Result set limit
        :type limit: int
        :param offset: Result set offset
        :type offset: int
        :param requiredfields: Array of the only field names that need to be returned. If empty, all fields will be returned.
        :type requiredfields: List[Optional[str]]
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param sort: Sort string
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_enrolled_courses_by_timeline_classification_serialize(
            classification=classification,
            customfieldname=customfieldname,
            customfieldvalue=customfieldvalue,
            limit=limit,
            offset=offset,
            requiredfields=requiredfields,
            searchvalue=searchvalue,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetEnrolledCoursesByTimelineClassificationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_get_enrolled_courses_by_timeline_classification_without_preload_content(
        self,
        classification: Annotated[Optional[StrictStr], Field(description="future, inprogress, or past")],
        customfieldname: Annotated[Optional[StrictStr], Field(description="Used when classification = customfield")] = None,
        customfieldvalue: Annotated[Optional[StrictStr], Field(description="Used when classification = customfield")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Result set limit")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Result set offset")] = None,
        requiredfields: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Array of the only field names that need to be returned. If empty, all fields will be returned.")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort string")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List of enrolled courses for the given timeline classification (past, inprogress, or future).

        List of enrolled courses for the given timeline classification (past, inprogress, or future).

        :param classification: future, inprogress, or past (required)
        :type classification: str
        :param customfieldname: Used when classification = customfield
        :type customfieldname: str
        :param customfieldvalue: Used when classification = customfield
        :type customfieldvalue: str
        :param limit: Result set limit
        :type limit: int
        :param offset: Result set offset
        :type offset: int
        :param requiredfields: Array of the only field names that need to be returned. If empty, all fields will be returned.
        :type requiredfields: List[Optional[str]]
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param sort: Sort string
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_enrolled_courses_by_timeline_classification_serialize(
            classification=classification,
            customfieldname=customfieldname,
            customfieldvalue=customfieldvalue,
            limit=limit,
            offset=offset,
            requiredfields=requiredfields,
            searchvalue=searchvalue,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetEnrolledCoursesByTimelineClassificationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_get_enrolled_courses_by_timeline_classification_serialize(
        self,
        classification,
        customfieldname,
        customfieldvalue,
        limit,
        offset,
        requiredfields,
        searchvalue,
        sort,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'requiredfields': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_get_enrolled_courses_by_timeline_classification'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_get_enrolled_courses_by_timeline_classification'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_get_enrolled_courses_by_timeline_classification',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if classification is not None:
            _form_params += parse_form({'classification': classification})
        if customfieldname is not None:
            _form_params += parse_form({'customfieldname': customfieldname})
        if customfieldvalue is not None:
            _form_params += parse_form({'customfieldvalue': customfieldvalue})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if offset is not None:
            _form_params += parse_form({'offset': offset})
        if requiredfields is not None:
            _form_params += parse_form({'requiredfields': requiredfields})
        if searchvalue is not None:
            _form_params += parse_form({'searchvalue': searchvalue})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_get_enrolled_courses_with_action_events_by_timeline_classification_args(
        self,
        classification: Annotated[Optional[StrictStr], Field(description="future, inprogress, or past")],
        customfieldname: Annotated[Optional[StrictStr], Field(description="Used when classification = customfield")] = None,
        customfieldvalue: Annotated[Optional[StrictStr], Field(description="Used when classification = customfield")] = None,
        eventsfrom: Annotated[Optional[StrictInt], Field(description="Optional starting timestamp for action events")] = None,
        eventsto: Annotated[Optional[StrictInt], Field(description="Optional ending timestamp for action events")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Result set limit")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Result set offset")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort string")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """List of enrolled courses with action events in a given timeframe, for the given timeline classification.

        List of enrolled courses with action events in a given timeframe, for the given timeline classification.

        :param classification: future, inprogress, or past (required)
        :type classification: str
        :param customfieldname: Used when classification = customfield
        :type customfieldname: str
        :param customfieldvalue: Used when classification = customfield
        :type customfieldvalue: str
        :param eventsfrom: Optional starting timestamp for action events
        :type eventsfrom: int
        :param eventsto: Optional ending timestamp for action events
        :type eventsto: int
        :param limit: Result set limit
        :type limit: int
        :param offset: Result set offset
        :type offset: int
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param sort: Sort string
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_enrolled_courses_with_action_events_by_timeline_classification_serialize(
            classification=classification,
            customfieldname=customfieldname,
            customfieldvalue=customfieldvalue,
            eventsfrom=eventsfrom,
            eventsto=eventsto,
            limit=limit,
            offset=offset,
            searchvalue=searchvalue,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetEnrolledCoursesWithActionEventsByTimelineClassificationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_get_enrolled_courses_with_action_events_by_timeline_classification(
        self,
        classification: Annotated[Optional[StrictStr], Field(description="future, inprogress, or past")],
        customfieldname: Annotated[Optional[StrictStr], Field(description="Used when classification = customfield")] = None,
        customfieldvalue: Annotated[Optional[StrictStr], Field(description="Used when classification = customfield")] = None,
        eventsfrom: Annotated[Optional[StrictInt], Field(description="Optional starting timestamp for action events")] = None,
        eventsto: Annotated[Optional[StrictInt], Field(description="Optional ending timestamp for action events")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Result set limit")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Result set offset")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort string")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseGetEnrolledCoursesWithActionEventsByTimelineClassificationResponse:
        """List of enrolled courses with action events in a given timeframe, for the given timeline classification.

        List of enrolled courses with action events in a given timeframe, for the given timeline classification.

        :param classification: future, inprogress, or past (required)
        :type classification: str
        :param customfieldname: Used when classification = customfield
        :type customfieldname: str
        :param customfieldvalue: Used when classification = customfield
        :type customfieldvalue: str
        :param eventsfrom: Optional starting timestamp for action events
        :type eventsfrom: int
        :param eventsto: Optional ending timestamp for action events
        :type eventsto: int
        :param limit: Result set limit
        :type limit: int
        :param offset: Result set offset
        :type offset: int
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param sort: Sort string
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_enrolled_courses_with_action_events_by_timeline_classification_serialize(
            classification=classification,
            customfieldname=customfieldname,
            customfieldvalue=customfieldvalue,
            eventsfrom=eventsfrom,
            eventsto=eventsto,
            limit=limit,
            offset=offset,
            searchvalue=searchvalue,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetEnrolledCoursesWithActionEventsByTimelineClassificationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_enrolled_courses_with_action_events_by_timeline_classification_from_args(
        self,
        args
    ) -> CoreCourseGetEnrolledCoursesWithActionEventsByTimelineClassificationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetEnrolledCoursesWithActionEventsByTimelineClassificationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_enrolled_courses_with_action_events_by_timeline_classification_with_http_info(
        self,
        classification: Annotated[Optional[StrictStr], Field(description="future, inprogress, or past")],
        customfieldname: Annotated[Optional[StrictStr], Field(description="Used when classification = customfield")] = None,
        customfieldvalue: Annotated[Optional[StrictStr], Field(description="Used when classification = customfield")] = None,
        eventsfrom: Annotated[Optional[StrictInt], Field(description="Optional starting timestamp for action events")] = None,
        eventsto: Annotated[Optional[StrictInt], Field(description="Optional ending timestamp for action events")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Result set limit")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Result set offset")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort string")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseGetEnrolledCoursesWithActionEventsByTimelineClassificationResponse]:
        """List of enrolled courses with action events in a given timeframe, for the given timeline classification.

        List of enrolled courses with action events in a given timeframe, for the given timeline classification.

        :param classification: future, inprogress, or past (required)
        :type classification: str
        :param customfieldname: Used when classification = customfield
        :type customfieldname: str
        :param customfieldvalue: Used when classification = customfield
        :type customfieldvalue: str
        :param eventsfrom: Optional starting timestamp for action events
        :type eventsfrom: int
        :param eventsto: Optional ending timestamp for action events
        :type eventsto: int
        :param limit: Result set limit
        :type limit: int
        :param offset: Result set offset
        :type offset: int
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param sort: Sort string
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_enrolled_courses_with_action_events_by_timeline_classification_serialize(
            classification=classification,
            customfieldname=customfieldname,
            customfieldvalue=customfieldvalue,
            eventsfrom=eventsfrom,
            eventsto=eventsto,
            limit=limit,
            offset=offset,
            searchvalue=searchvalue,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetEnrolledCoursesWithActionEventsByTimelineClassificationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_get_enrolled_courses_with_action_events_by_timeline_classification_without_preload_content(
        self,
        classification: Annotated[Optional[StrictStr], Field(description="future, inprogress, or past")],
        customfieldname: Annotated[Optional[StrictStr], Field(description="Used when classification = customfield")] = None,
        customfieldvalue: Annotated[Optional[StrictStr], Field(description="Used when classification = customfield")] = None,
        eventsfrom: Annotated[Optional[StrictInt], Field(description="Optional starting timestamp for action events")] = None,
        eventsto: Annotated[Optional[StrictInt], Field(description="Optional ending timestamp for action events")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Result set limit")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Result set offset")] = None,
        searchvalue: Annotated[Optional[StrictStr], Field(description="The value a user wishes to search against")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort string")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List of enrolled courses with action events in a given timeframe, for the given timeline classification.

        List of enrolled courses with action events in a given timeframe, for the given timeline classification.

        :param classification: future, inprogress, or past (required)
        :type classification: str
        :param customfieldname: Used when classification = customfield
        :type customfieldname: str
        :param customfieldvalue: Used when classification = customfield
        :type customfieldvalue: str
        :param eventsfrom: Optional starting timestamp for action events
        :type eventsfrom: int
        :param eventsto: Optional ending timestamp for action events
        :type eventsto: int
        :param limit: Result set limit
        :type limit: int
        :param offset: Result set offset
        :type offset: int
        :param searchvalue: The value a user wishes to search against
        :type searchvalue: str
        :param sort: Sort string
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_enrolled_courses_with_action_events_by_timeline_classification_serialize(
            classification=classification,
            customfieldname=customfieldname,
            customfieldvalue=customfieldvalue,
            eventsfrom=eventsfrom,
            eventsto=eventsto,
            limit=limit,
            offset=offset,
            searchvalue=searchvalue,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetEnrolledCoursesWithActionEventsByTimelineClassificationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_get_enrolled_courses_with_action_events_by_timeline_classification_serialize(
        self,
        classification,
        customfieldname,
        customfieldvalue,
        eventsfrom,
        eventsto,
        limit,
        offset,
        searchvalue,
        sort,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_course_get_enrolled_courses_with_action_events_by_timeline_classification'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_get_enrolled_courses_with_action_events_by_timeline_classification'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_get_enrolled_courses_with_action_events_by_timeline_classification',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if classification is not None:
            _form_params += parse_form({'classification': classification})
        if customfieldname is not None:
            _form_params += parse_form({'customfieldname': customfieldname})
        if customfieldvalue is not None:
            _form_params += parse_form({'customfieldvalue': customfieldvalue})
        if eventsfrom is not None:
            _form_params += parse_form({'eventsfrom': eventsfrom})
        if eventsto is not None:
            _form_params += parse_form({'eventsto': eventsto})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if offset is not None:
            _form_params += parse_form({'offset': offset})
        if searchvalue is not None:
            _form_params += parse_form({'searchvalue': searchvalue})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_get_enrolled_users_by_cmid_args(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="id of the course module")],
        groupid: Annotated[Optional[StrictInt], Field(description="id of the group")] = None,
        onlyactive: Annotated[Optional[StrictBool], Field(description="whether to return only active users or all.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """List users by course module id, filter by group and active enrolment status.

        List users by course module id, filter by group and active enrolment status.

        :param cmid: id of the course module (required)
        :type cmid: int
        :param groupid: id of the group
        :type groupid: int
        :param onlyactive: whether to return only active users or all.
        :type onlyactive: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_enrolled_users_by_cmid_serialize(
            cmid=cmid,
            groupid=groupid,
            onlyactive=onlyactive,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetEnrolledUsersByCmidResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_get_enrolled_users_by_cmid(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="id of the course module")],
        groupid: Annotated[Optional[StrictInt], Field(description="id of the group")] = None,
        onlyactive: Annotated[Optional[StrictBool], Field(description="whether to return only active users or all.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseGetEnrolledUsersByCmidResponse:
        """List users by course module id, filter by group and active enrolment status.

        List users by course module id, filter by group and active enrolment status.

        :param cmid: id of the course module (required)
        :type cmid: int
        :param groupid: id of the group
        :type groupid: int
        :param onlyactive: whether to return only active users or all.
        :type onlyactive: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_enrolled_users_by_cmid_serialize(
            cmid=cmid,
            groupid=groupid,
            onlyactive=onlyactive,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetEnrolledUsersByCmidResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_enrolled_users_by_cmid_from_args(
        self,
        args
    ) -> CoreCourseGetEnrolledUsersByCmidResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetEnrolledUsersByCmidResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_enrolled_users_by_cmid_with_http_info(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="id of the course module")],
        groupid: Annotated[Optional[StrictInt], Field(description="id of the group")] = None,
        onlyactive: Annotated[Optional[StrictBool], Field(description="whether to return only active users or all.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseGetEnrolledUsersByCmidResponse]:
        """List users by course module id, filter by group and active enrolment status.

        List users by course module id, filter by group and active enrolment status.

        :param cmid: id of the course module (required)
        :type cmid: int
        :param groupid: id of the group
        :type groupid: int
        :param onlyactive: whether to return only active users or all.
        :type onlyactive: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_enrolled_users_by_cmid_serialize(
            cmid=cmid,
            groupid=groupid,
            onlyactive=onlyactive,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetEnrolledUsersByCmidResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_get_enrolled_users_by_cmid_without_preload_content(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="id of the course module")],
        groupid: Annotated[Optional[StrictInt], Field(description="id of the group")] = None,
        onlyactive: Annotated[Optional[StrictBool], Field(description="whether to return only active users or all.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List users by course module id, filter by group and active enrolment status.

        List users by course module id, filter by group and active enrolment status.

        :param cmid: id of the course module (required)
        :type cmid: int
        :param groupid: id of the group
        :type groupid: int
        :param onlyactive: whether to return only active users or all.
        :type onlyactive: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_enrolled_users_by_cmid_serialize(
            cmid=cmid,
            groupid=groupid,
            onlyactive=onlyactive,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetEnrolledUsersByCmidResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_get_enrolled_users_by_cmid_serialize(
        self,
        cmid,
        groupid,
        onlyactive,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_course_get_enrolled_users_by_cmid'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_get_enrolled_users_by_cmid'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_get_enrolled_users_by_cmid',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if onlyactive is not None:
            _form_params += parse_form({'onlyactive': onlyactive})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_get_module_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="course module id")],
        sectionreturn: Annotated[Optional[StrictInt], Field(description="section to return to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).Returns html with one activity module on course page.Use fragment API using component core_courseformat and fragment cmitem instead.

        ** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).Returns html with one activity module on course page.Use fragment API using component core_courseformat and fragment cmitem instead.

        :param id: course module id (required)
        :type id: int
        :param sectionreturn: section to return to
        :type sectionreturn: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_module_serialize(
            id=id,
            sectionreturn=sectionreturn,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_get_module(
        self,
        id: Annotated[Optional[StrictInt], Field(description="course module id")],
        sectionreturn: Annotated[Optional[StrictInt], Field(description="section to return to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).Returns html with one activity module on course page.Use fragment API using component core_courseformat and fragment cmitem instead.

        ** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).Returns html with one activity module on course page.Use fragment API using component core_courseformat and fragment cmitem instead.

        :param id: course module id (required)
        :type id: int
        :param sectionreturn: section to return to
        :type sectionreturn: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_module_serialize(
            id=id,
            sectionreturn=sectionreturn,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_module_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_module_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="course module id")],
        sectionreturn: Annotated[Optional[StrictInt], Field(description="section to return to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).Returns html with one activity module on course page.Use fragment API using component core_courseformat and fragment cmitem instead.

        ** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).Returns html with one activity module on course page.Use fragment API using component core_courseformat and fragment cmitem instead.

        :param id: course module id (required)
        :type id: int
        :param sectionreturn: section to return to
        :type sectionreturn: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_module_serialize(
            id=id,
            sectionreturn=sectionreturn,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_get_module_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="course module id")],
        sectionreturn: Annotated[Optional[StrictInt], Field(description="section to return to")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).Returns html with one activity module on course page.Use fragment API using component core_courseformat and fragment cmitem instead.

        ** DEPRECATED ** Please do not call this function any more (will be removed in Moodle 6.0).Returns html with one activity module on course page.Use fragment API using component core_courseformat and fragment cmitem instead.

        :param id: course module id (required)
        :type id: int
        :param sectionreturn: section to return to
        :type sectionreturn: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_module_serialize(
            id=id,
            sectionreturn=sectionreturn,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_get_module_serialize(
        self,
        id,
        sectionreturn,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_course_get_module'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_get_module'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_get_module',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        if sectionreturn is not None:
            _form_params += parse_form({'sectionreturn': sectionreturn})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_get_recent_courses_args(
        self,
        limit: Annotated[Optional[StrictInt], Field(description="result set limit")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Result set offset")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort string")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, default to current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """List of courses a user has accessed most recently.

        List of courses a user has accessed most recently.

        :param limit: result set limit
        :type limit: int
        :param offset: Result set offset
        :type offset: int
        :param sort: Sort string
        :type sort: str
        :param userid: id of the user, default to current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_recent_courses_serialize(
            limit=limit,
            offset=offset,
            sort=sort,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockStarredcoursesGetStarredCoursesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_get_recent_courses(
        self,
        limit: Annotated[Optional[StrictInt], Field(description="result set limit")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Result set offset")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort string")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, default to current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[BlockStarredcoursesGetStarredCoursesResponseInner]:
        """List of courses a user has accessed most recently.

        List of courses a user has accessed most recently.

        :param limit: result set limit
        :type limit: int
        :param offset: Result set offset
        :type offset: int
        :param sort: Sort string
        :type sort: str
        :param userid: id of the user, default to current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_recent_courses_serialize(
            limit=limit,
            offset=offset,
            sort=sort,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockStarredcoursesGetStarredCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_recent_courses_from_args(
        self,
        args
    ) -> List[BlockStarredcoursesGetStarredCoursesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockStarredcoursesGetStarredCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_recent_courses_with_http_info(
        self,
        limit: Annotated[Optional[StrictInt], Field(description="result set limit")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Result set offset")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort string")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, default to current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[BlockStarredcoursesGetStarredCoursesResponseInner]]:
        """List of courses a user has accessed most recently.

        List of courses a user has accessed most recently.

        :param limit: result set limit
        :type limit: int
        :param offset: Result set offset
        :type offset: int
        :param sort: Sort string
        :type sort: str
        :param userid: id of the user, default to current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_recent_courses_serialize(
            limit=limit,
            offset=offset,
            sort=sort,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockStarredcoursesGetStarredCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_get_recent_courses_without_preload_content(
        self,
        limit: Annotated[Optional[StrictInt], Field(description="result set limit")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Result set offset")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort string")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, default to current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List of courses a user has accessed most recently.

        List of courses a user has accessed most recently.

        :param limit: result set limit
        :type limit: int
        :param offset: Result set offset
        :type offset: int
        :param sort: Sort string
        :type sort: str
        :param userid: id of the user, default to current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_recent_courses_serialize(
            limit=limit,
            offset=offset,
            sort=sort,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockStarredcoursesGetStarredCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_get_recent_courses_serialize(
        self,
        limit,
        offset,
        sort,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_course_get_recent_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_get_recent_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_get_recent_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if offset is not None:
            _form_params += parse_form({'offset': offset})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_get_updates_since_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id to check")],
        since: Annotated[Optional[StrictInt], Field(description="Check updates since this time stamp")],
        filter: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Check only for updates in these areas")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Check if there are updates affecting the user for the given course since the given time stamp.

        Check if there are updates affecting the user for the given course since the given time stamp.

        :param courseid: Course id to check (required)
        :type courseid: int
        :param since: Check updates since this time stamp (required)
        :type since: int
        :param filter: Check only for updates in these areas
        :type filter: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_updates_since_serialize(
            courseid=courseid,
            since=since,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetUpdatesSinceResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_get_updates_since(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id to check")],
        since: Annotated[Optional[StrictInt], Field(description="Check updates since this time stamp")],
        filter: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Check only for updates in these areas")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseGetUpdatesSinceResponse:
        """Check if there are updates affecting the user for the given course since the given time stamp.

        Check if there are updates affecting the user for the given course since the given time stamp.

        :param courseid: Course id to check (required)
        :type courseid: int
        :param since: Check updates since this time stamp (required)
        :type since: int
        :param filter: Check only for updates in these areas
        :type filter: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_updates_since_serialize(
            courseid=courseid,
            since=since,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetUpdatesSinceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_updates_since_from_args(
        self,
        args
    ) -> CoreCourseGetUpdatesSinceResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetUpdatesSinceResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_updates_since_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id to check")],
        since: Annotated[Optional[StrictInt], Field(description="Check updates since this time stamp")],
        filter: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Check only for updates in these areas")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseGetUpdatesSinceResponse]:
        """Check if there are updates affecting the user for the given course since the given time stamp.

        Check if there are updates affecting the user for the given course since the given time stamp.

        :param courseid: Course id to check (required)
        :type courseid: int
        :param since: Check updates since this time stamp (required)
        :type since: int
        :param filter: Check only for updates in these areas
        :type filter: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_updates_since_serialize(
            courseid=courseid,
            since=since,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetUpdatesSinceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_get_updates_since_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id to check")],
        since: Annotated[Optional[StrictInt], Field(description="Check updates since this time stamp")],
        filter: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Check only for updates in these areas")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Check if there are updates affecting the user for the given course since the given time stamp.

        Check if there are updates affecting the user for the given course since the given time stamp.

        :param courseid: Course id to check (required)
        :type courseid: int
        :param since: Check updates since this time stamp (required)
        :type since: int
        :param filter: Check only for updates in these areas
        :type filter: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_updates_since_serialize(
            courseid=courseid,
            since=since,
            filter=filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetUpdatesSinceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_get_updates_since_serialize(
        self,
        courseid,
        since,
        filter,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'filter': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_get_updates_since'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_get_updates_since'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_get_updates_since',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if filter is not None:
            _form_params += parse_form({'filter': filter})
        if since is not None:
            _form_params += parse_form({'since': since})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_get_user_administration_options_args(
        self,
        courseids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return a list of administration options in a set of courses that are avaialable or not for the current                             user.

        Return a list of administration options in a set of courses that are avaialable or not for the current                             user.

        :param courseids: (required)
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_user_administration_options_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetUserAdministrationOptionsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_get_user_administration_options(
        self,
        courseids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseGetUserAdministrationOptionsResponse:
        """Return a list of administration options in a set of courses that are avaialable or not for the current                             user.

        Return a list of administration options in a set of courses that are avaialable or not for the current                             user.

        :param courseids: (required)
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_user_administration_options_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetUserAdministrationOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_user_administration_options_from_args(
        self,
        args
    ) -> CoreCourseGetUserAdministrationOptionsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetUserAdministrationOptionsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_user_administration_options_with_http_info(
        self,
        courseids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseGetUserAdministrationOptionsResponse]:
        """Return a list of administration options in a set of courses that are avaialable or not for the current                             user.

        Return a list of administration options in a set of courses that are avaialable or not for the current                             user.

        :param courseids: (required)
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_user_administration_options_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetUserAdministrationOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_get_user_administration_options_without_preload_content(
        self,
        courseids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return a list of administration options in a set of courses that are avaialable or not for the current                             user.

        Return a list of administration options in a set of courses that are avaialable or not for the current                             user.

        :param courseids: (required)
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_user_administration_options_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetUserAdministrationOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_get_user_administration_options_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_get_user_administration_options'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_get_user_administration_options'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_get_user_administration_options',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_get_user_navigation_options_args(
        self,
        courseids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return a list of navigation options in a set of courses that are avaialable or not for the current user.

        Return a list of navigation options in a set of courses that are avaialable or not for the current user.

        :param courseids: (required)
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_user_navigation_options_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetUserNavigationOptionsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_get_user_navigation_options(
        self,
        courseids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseGetUserNavigationOptionsResponse:
        """Return a list of navigation options in a set of courses that are avaialable or not for the current user.

        Return a list of navigation options in a set of courses that are avaialable or not for the current user.

        :param courseids: (required)
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_user_navigation_options_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetUserNavigationOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_user_navigation_options_from_args(
        self,
        args
    ) -> CoreCourseGetUserNavigationOptionsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetUserNavigationOptionsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_get_user_navigation_options_with_http_info(
        self,
        courseids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseGetUserNavigationOptionsResponse]:
        """Return a list of navigation options in a set of courses that are avaialable or not for the current user.

        Return a list of navigation options in a set of courses that are avaialable or not for the current user.

        :param courseids: (required)
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_user_navigation_options_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetUserNavigationOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_get_user_navigation_options_without_preload_content(
        self,
        courseids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return a list of navigation options in a set of courses that are avaialable or not for the current user.

        Return a list of navigation options in a set of courses that are avaialable or not for the current user.

        :param courseids: (required)
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_get_user_navigation_options_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseGetUserNavigationOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_get_user_navigation_options_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_get_user_navigation_options'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_get_user_navigation_options'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_get_user_navigation_options',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_import_course_args(
        self,
        importfrom: Annotated[Optional[StrictInt], Field(description="the id of the course we are importing from")],
        importto: Annotated[Optional[StrictInt], Field(description="the id of the course we are importing to")],
        deletecontent: Annotated[Optional[StrictInt], Field(description="whether to delete the course content where we are importing to (default to 0 = No)")] = None,
        options: Annotated[Optional[List[CoreCourseImportCourseParametersOptionsInner]], Field(description="Course import options")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Import course data from a course into another course. Does not include any user data.

        Import course data from a course into another course. Does not include any user data.

        :param importfrom: the id of the course we are importing from (required)
        :type importfrom: int
        :param importto: the id of the course we are importing to (required)
        :type importto: int
        :param deletecontent: whether to delete the course content where we are importing to (default to 0 = No)
        :type deletecontent: int
        :param options: Course import options
        :type options: List[CoreCourseImportCourseParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_import_course_serialize(
            importfrom=importfrom,
            importto=importto,
            deletecontent=deletecontent,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_import_course(
        self,
        importfrom: Annotated[Optional[StrictInt], Field(description="the id of the course we are importing from")],
        importto: Annotated[Optional[StrictInt], Field(description="the id of the course we are importing to")],
        deletecontent: Annotated[Optional[StrictInt], Field(description="whether to delete the course content where we are importing to (default to 0 = No)")] = None,
        options: Annotated[Optional[List[CoreCourseImportCourseParametersOptionsInner]], Field(description="Course import options")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Import course data from a course into another course. Does not include any user data.

        Import course data from a course into another course. Does not include any user data.

        :param importfrom: the id of the course we are importing from (required)
        :type importfrom: int
        :param importto: the id of the course we are importing to (required)
        :type importto: int
        :param deletecontent: whether to delete the course content where we are importing to (default to 0 = No)
        :type deletecontent: int
        :param options: Course import options
        :type options: List[CoreCourseImportCourseParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_import_course_serialize(
            importfrom=importfrom,
            importto=importto,
            deletecontent=deletecontent,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_import_course_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_import_course_with_http_info(
        self,
        importfrom: Annotated[Optional[StrictInt], Field(description="the id of the course we are importing from")],
        importto: Annotated[Optional[StrictInt], Field(description="the id of the course we are importing to")],
        deletecontent: Annotated[Optional[StrictInt], Field(description="whether to delete the course content where we are importing to (default to 0 = No)")] = None,
        options: Annotated[Optional[List[CoreCourseImportCourseParametersOptionsInner]], Field(description="Course import options")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Import course data from a course into another course. Does not include any user data.

        Import course data from a course into another course. Does not include any user data.

        :param importfrom: the id of the course we are importing from (required)
        :type importfrom: int
        :param importto: the id of the course we are importing to (required)
        :type importto: int
        :param deletecontent: whether to delete the course content where we are importing to (default to 0 = No)
        :type deletecontent: int
        :param options: Course import options
        :type options: List[CoreCourseImportCourseParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_import_course_serialize(
            importfrom=importfrom,
            importto=importto,
            deletecontent=deletecontent,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_import_course_without_preload_content(
        self,
        importfrom: Annotated[Optional[StrictInt], Field(description="the id of the course we are importing from")],
        importto: Annotated[Optional[StrictInt], Field(description="the id of the course we are importing to")],
        deletecontent: Annotated[Optional[StrictInt], Field(description="whether to delete the course content where we are importing to (default to 0 = No)")] = None,
        options: Annotated[Optional[List[CoreCourseImportCourseParametersOptionsInner]], Field(description="Course import options")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Import course data from a course into another course. Does not include any user data.

        Import course data from a course into another course. Does not include any user data.

        :param importfrom: the id of the course we are importing from (required)
        :type importfrom: int
        :param importto: the id of the course we are importing to (required)
        :type importto: int
        :param deletecontent: whether to delete the course content where we are importing to (default to 0 = No)
        :type deletecontent: int
        :param options: Course import options
        :type options: List[CoreCourseImportCourseParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_import_course_serialize(
            importfrom=importfrom,
            importto=importto,
            deletecontent=deletecontent,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_import_course_serialize(
        self,
        importfrom,
        importto,
        deletecontent,
        options,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'options': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_import_course'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_import_course'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_import_course',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if deletecontent is not None:
            _form_params += parse_form({'deletecontent': deletecontent})
        if importfrom is not None:
            _form_params += parse_form({'importfrom': importfrom})
        if importto is not None:
            _form_params += parse_form({'importto': importto})
        if options is not None:
            _form_params += parse_form({'options': options})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_remove_content_item_from_user_favourites_args(
        self,
        componentname: Annotated[Optional[StrictStr], Field(description="frankenstyle name of the component to which the content item belongs")],
        contentitemid: Annotated[StrictInt, Field(description="id of the content item")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Removes a content item (activity, resource or their subtypes) from the favourites for the user.

        Removes a content item (activity, resource or their subtypes) from the favourites for the user.

        :param componentname: frankenstyle name of the component to which the content item belongs (required)
        :type componentname: str
        :param contentitemid: id of the content item (required)
        :type contentitemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_remove_content_item_from_user_favourites_serialize(
            componentname=componentname,
            contentitemid=contentitemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseRemoveContentItemFromUserFavouritesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_remove_content_item_from_user_favourites(
        self,
        componentname: Annotated[Optional[StrictStr], Field(description="frankenstyle name of the component to which the content item belongs")],
        contentitemid: Annotated[StrictInt, Field(description="id of the content item")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseRemoveContentItemFromUserFavouritesResponse:
        """Removes a content item (activity, resource or their subtypes) from the favourites for the user.

        Removes a content item (activity, resource or their subtypes) from the favourites for the user.

        :param componentname: frankenstyle name of the component to which the content item belongs (required)
        :type componentname: str
        :param contentitemid: id of the content item (required)
        :type contentitemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_remove_content_item_from_user_favourites_serialize(
            componentname=componentname,
            contentitemid=contentitemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseRemoveContentItemFromUserFavouritesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_remove_content_item_from_user_favourites_from_args(
        self,
        args
    ) -> CoreCourseRemoveContentItemFromUserFavouritesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseRemoveContentItemFromUserFavouritesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_remove_content_item_from_user_favourites_with_http_info(
        self,
        componentname: Annotated[Optional[StrictStr], Field(description="frankenstyle name of the component to which the content item belongs")],
        contentitemid: Annotated[StrictInt, Field(description="id of the content item")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseRemoveContentItemFromUserFavouritesResponse]:
        """Removes a content item (activity, resource or their subtypes) from the favourites for the user.

        Removes a content item (activity, resource or their subtypes) from the favourites for the user.

        :param componentname: frankenstyle name of the component to which the content item belongs (required)
        :type componentname: str
        :param contentitemid: id of the content item (required)
        :type contentitemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_remove_content_item_from_user_favourites_serialize(
            componentname=componentname,
            contentitemid=contentitemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseRemoveContentItemFromUserFavouritesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_remove_content_item_from_user_favourites_without_preload_content(
        self,
        componentname: Annotated[Optional[StrictStr], Field(description="frankenstyle name of the component to which the content item belongs")],
        contentitemid: Annotated[StrictInt, Field(description="id of the content item")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Removes a content item (activity, resource or their subtypes) from the favourites for the user.

        Removes a content item (activity, resource or their subtypes) from the favourites for the user.

        :param componentname: frankenstyle name of the component to which the content item belongs (required)
        :type componentname: str
        :param contentitemid: id of the content item (required)
        :type contentitemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_remove_content_item_from_user_favourites_serialize(
            componentname=componentname,
            contentitemid=contentitemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseRemoveContentItemFromUserFavouritesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_remove_content_item_from_user_favourites_serialize(
        self,
        componentname,
        contentitemid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_course_remove_content_item_from_user_favourites'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_remove_content_item_from_user_favourites'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_remove_content_item_from_user_favourites',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if componentname is not None:
            _form_params += parse_form({'componentname': componentname})
        if contentitemid is not None:
            _form_params += parse_form({'contentitemid': contentitemid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_search_courses_args(
        self,
        criterianame: Annotated[Optional[StrictStr], Field(description="criteria name                                                         (search, modulelist (only admins), blocklist (only admins), tagid)")],
        criteriavalue: Annotated[Optional[StrictStr], Field(description="criteria value")],
        limittoenrolled: Annotated[Optional[StrictBool], Field(description="limit to enrolled courses")] = None,
        onlywithcompletion: Annotated[Optional[StrictBool], Field(description="limit to courses where completion is enabled")] = None,
        page: Annotated[Optional[StrictInt], Field(description="page number (0 based)")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="items per page")] = None,
        requiredcapabilities: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Optional list of required capabilities (used to filter the list)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Search courses by (name, module, block, tag)

        Search courses by (name, module, block, tag)

        :param criterianame: criteria name                                                         (search, modulelist (only admins), blocklist (only admins), tagid) (required)
        :type criterianame: str
        :param criteriavalue: criteria value (required)
        :type criteriavalue: str
        :param limittoenrolled: limit to enrolled courses
        :type limittoenrolled: bool
        :param onlywithcompletion: limit to courses where completion is enabled
        :type onlywithcompletion: bool
        :param page: page number (0 based)
        :type page: int
        :param perpage: items per page
        :type perpage: int
        :param requiredcapabilities: Optional list of required capabilities (used to filter the list)
        :type requiredcapabilities: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_search_courses_serialize(
            criterianame=criterianame,
            criteriavalue=criteriavalue,
            limittoenrolled=limittoenrolled,
            onlywithcompletion=onlywithcompletion,
            page=page,
            perpage=perpage,
            requiredcapabilities=requiredcapabilities,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseSearchCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_search_courses(
        self,
        criterianame: Annotated[Optional[StrictStr], Field(description="criteria name                                                         (search, modulelist (only admins), blocklist (only admins), tagid)")],
        criteriavalue: Annotated[Optional[StrictStr], Field(description="criteria value")],
        limittoenrolled: Annotated[Optional[StrictBool], Field(description="limit to enrolled courses")] = None,
        onlywithcompletion: Annotated[Optional[StrictBool], Field(description="limit to courses where completion is enabled")] = None,
        page: Annotated[Optional[StrictInt], Field(description="page number (0 based)")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="items per page")] = None,
        requiredcapabilities: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Optional list of required capabilities (used to filter the list)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseSearchCoursesResponse:
        """Search courses by (name, module, block, tag)

        Search courses by (name, module, block, tag)

        :param criterianame: criteria name                                                         (search, modulelist (only admins), blocklist (only admins), tagid) (required)
        :type criterianame: str
        :param criteriavalue: criteria value (required)
        :type criteriavalue: str
        :param limittoenrolled: limit to enrolled courses
        :type limittoenrolled: bool
        :param onlywithcompletion: limit to courses where completion is enabled
        :type onlywithcompletion: bool
        :param page: page number (0 based)
        :type page: int
        :param perpage: items per page
        :type perpage: int
        :param requiredcapabilities: Optional list of required capabilities (used to filter the list)
        :type requiredcapabilities: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_search_courses_serialize(
            criterianame=criterianame,
            criteriavalue=criteriavalue,
            limittoenrolled=limittoenrolled,
            onlywithcompletion=onlywithcompletion,
            page=page,
            perpage=perpage,
            requiredcapabilities=requiredcapabilities,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseSearchCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_search_courses_from_args(
        self,
        args
    ) -> CoreCourseSearchCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseSearchCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_search_courses_with_http_info(
        self,
        criterianame: Annotated[Optional[StrictStr], Field(description="criteria name                                                         (search, modulelist (only admins), blocklist (only admins), tagid)")],
        criteriavalue: Annotated[Optional[StrictStr], Field(description="criteria value")],
        limittoenrolled: Annotated[Optional[StrictBool], Field(description="limit to enrolled courses")] = None,
        onlywithcompletion: Annotated[Optional[StrictBool], Field(description="limit to courses where completion is enabled")] = None,
        page: Annotated[Optional[StrictInt], Field(description="page number (0 based)")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="items per page")] = None,
        requiredcapabilities: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Optional list of required capabilities (used to filter the list)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseSearchCoursesResponse]:
        """Search courses by (name, module, block, tag)

        Search courses by (name, module, block, tag)

        :param criterianame: criteria name                                                         (search, modulelist (only admins), blocklist (only admins), tagid) (required)
        :type criterianame: str
        :param criteriavalue: criteria value (required)
        :type criteriavalue: str
        :param limittoenrolled: limit to enrolled courses
        :type limittoenrolled: bool
        :param onlywithcompletion: limit to courses where completion is enabled
        :type onlywithcompletion: bool
        :param page: page number (0 based)
        :type page: int
        :param perpage: items per page
        :type perpage: int
        :param requiredcapabilities: Optional list of required capabilities (used to filter the list)
        :type requiredcapabilities: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_search_courses_serialize(
            criterianame=criterianame,
            criteriavalue=criteriavalue,
            limittoenrolled=limittoenrolled,
            onlywithcompletion=onlywithcompletion,
            page=page,
            perpage=perpage,
            requiredcapabilities=requiredcapabilities,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseSearchCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_search_courses_without_preload_content(
        self,
        criterianame: Annotated[Optional[StrictStr], Field(description="criteria name                                                         (search, modulelist (only admins), blocklist (only admins), tagid)")],
        criteriavalue: Annotated[Optional[StrictStr], Field(description="criteria value")],
        limittoenrolled: Annotated[Optional[StrictBool], Field(description="limit to enrolled courses")] = None,
        onlywithcompletion: Annotated[Optional[StrictBool], Field(description="limit to courses where completion is enabled")] = None,
        page: Annotated[Optional[StrictInt], Field(description="page number (0 based)")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="items per page")] = None,
        requiredcapabilities: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Optional list of required capabilities (used to filter the list)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Search courses by (name, module, block, tag)

        Search courses by (name, module, block, tag)

        :param criterianame: criteria name                                                         (search, modulelist (only admins), blocklist (only admins), tagid) (required)
        :type criterianame: str
        :param criteriavalue: criteria value (required)
        :type criteriavalue: str
        :param limittoenrolled: limit to enrolled courses
        :type limittoenrolled: bool
        :param onlywithcompletion: limit to courses where completion is enabled
        :type onlywithcompletion: bool
        :param page: page number (0 based)
        :type page: int
        :param perpage: items per page
        :type perpage: int
        :param requiredcapabilities: Optional list of required capabilities (used to filter the list)
        :type requiredcapabilities: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_search_courses_serialize(
            criterianame=criterianame,
            criteriavalue=criteriavalue,
            limittoenrolled=limittoenrolled,
            onlywithcompletion=onlywithcompletion,
            page=page,
            perpage=perpage,
            requiredcapabilities=requiredcapabilities,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseSearchCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_search_courses_serialize(
        self,
        criterianame,
        criteriavalue,
        limittoenrolled,
        onlywithcompletion,
        page,
        perpage,
        requiredcapabilities,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'requiredcapabilities': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_search_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_search_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_search_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if criterianame is not None:
            _form_params += parse_form({'criterianame': criterianame})
        if criteriavalue is not None:
            _form_params += parse_form({'criteriavalue': criteriavalue})
        if limittoenrolled is not None:
            _form_params += parse_form({'limittoenrolled': limittoenrolled})
        if onlywithcompletion is not None:
            _form_params += parse_form({'onlywithcompletion': onlywithcompletion})
        if page is not None:
            _form_params += parse_form({'page': page})
        if perpage is not None:
            _form_params += parse_form({'perpage': perpage})
        if requiredcapabilities is not None:
            _form_params += parse_form({'requiredcapabilities': requiredcapabilities})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_set_favourite_courses_args(
        self,
        courses: List[CoreCourseSetFavouriteCoursesParametersCoursesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Add a list of courses to the list of favourite courses.

        Add a list of courses to the list of favourite courses.

        :param courses: (required)
        :type courses: List[CoreCourseSetFavouriteCoursesParametersCoursesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_set_favourite_courses_serialize(
            courses=courses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseSetFavouriteCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_set_favourite_courses(
        self,
        courses: List[CoreCourseSetFavouriteCoursesParametersCoursesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseSetFavouriteCoursesResponse:
        """Add a list of courses to the list of favourite courses.

        Add a list of courses to the list of favourite courses.

        :param courses: (required)
        :type courses: List[CoreCourseSetFavouriteCoursesParametersCoursesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_set_favourite_courses_serialize(
            courses=courses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseSetFavouriteCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_set_favourite_courses_from_args(
        self,
        args
    ) -> CoreCourseSetFavouriteCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseSetFavouriteCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_set_favourite_courses_with_http_info(
        self,
        courses: List[CoreCourseSetFavouriteCoursesParametersCoursesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseSetFavouriteCoursesResponse]:
        """Add a list of courses to the list of favourite courses.

        Add a list of courses to the list of favourite courses.

        :param courses: (required)
        :type courses: List[CoreCourseSetFavouriteCoursesParametersCoursesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_set_favourite_courses_serialize(
            courses=courses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseSetFavouriteCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_set_favourite_courses_without_preload_content(
        self,
        courses: List[CoreCourseSetFavouriteCoursesParametersCoursesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Add a list of courses to the list of favourite courses.

        Add a list of courses to the list of favourite courses.

        :param courses: (required)
        :type courses: List[CoreCourseSetFavouriteCoursesParametersCoursesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_set_favourite_courses_serialize(
            courses=courses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseSetFavouriteCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_set_favourite_courses_serialize(
        self,
        courses,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courses': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_set_favourite_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_set_favourite_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_set_favourite_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courses is not None:
            _form_params += parse_form({'courses': courses})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_toggle_activity_recommendation_args(
        self,
        area: Annotated[Optional[StrictStr], Field(description="The favourite area (itemtype)")],
        id: Annotated[Optional[StrictInt], Field(description="id of the activity or whatever")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Adds or removes an activity as a recommendation in the activity chooser.

        Adds or removes an activity as a recommendation in the activity chooser.

        :param area: The favourite area (itemtype) (required)
        :type area: str
        :param id: id of the activity or whatever (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_toggle_activity_recommendation_serialize(
            area=area,
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseToggleActivityRecommendationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_toggle_activity_recommendation(
        self,
        area: Annotated[Optional[StrictStr], Field(description="The favourite area (itemtype)")],
        id: Annotated[Optional[StrictInt], Field(description="id of the activity or whatever")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseToggleActivityRecommendationResponse:
        """Adds or removes an activity as a recommendation in the activity chooser.

        Adds or removes an activity as a recommendation in the activity chooser.

        :param area: The favourite area (itemtype) (required)
        :type area: str
        :param id: id of the activity or whatever (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_toggle_activity_recommendation_serialize(
            area=area,
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseToggleActivityRecommendationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_toggle_activity_recommendation_from_args(
        self,
        args
    ) -> CoreCourseToggleActivityRecommendationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseToggleActivityRecommendationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_toggle_activity_recommendation_with_http_info(
        self,
        area: Annotated[Optional[StrictStr], Field(description="The favourite area (itemtype)")],
        id: Annotated[Optional[StrictInt], Field(description="id of the activity or whatever")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseToggleActivityRecommendationResponse]:
        """Adds or removes an activity as a recommendation in the activity chooser.

        Adds or removes an activity as a recommendation in the activity chooser.

        :param area: The favourite area (itemtype) (required)
        :type area: str
        :param id: id of the activity or whatever (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_toggle_activity_recommendation_serialize(
            area=area,
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseToggleActivityRecommendationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_toggle_activity_recommendation_without_preload_content(
        self,
        area: Annotated[Optional[StrictStr], Field(description="The favourite area (itemtype)")],
        id: Annotated[Optional[StrictInt], Field(description="id of the activity or whatever")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Adds or removes an activity as a recommendation in the activity chooser.

        Adds or removes an activity as a recommendation in the activity chooser.

        :param area: The favourite area (itemtype) (required)
        :type area: str
        :param id: id of the activity or whatever (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_toggle_activity_recommendation_serialize(
            area=area,
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseToggleActivityRecommendationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_toggle_activity_recommendation_serialize(
        self,
        area,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_course_toggle_activity_recommendation'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_toggle_activity_recommendation'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_toggle_activity_recommendation',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if area is not None:
            _form_params += parse_form({'area': area})
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_update_categories_args(
        self,
        categories: List[CoreCourseUpdateCategoriesParametersCategoriesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update categories

        Update categories

        :param categories: (required)
        :type categories: List[CoreCourseUpdateCategoriesParametersCategoriesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_update_categories_serialize(
            categories=categories,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_update_categories(
        self,
        categories: List[CoreCourseUpdateCategoriesParametersCategoriesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Update categories

        Update categories

        :param categories: (required)
        :type categories: List[CoreCourseUpdateCategoriesParametersCategoriesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_update_categories_serialize(
            categories=categories,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_update_categories_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_update_categories_with_http_info(
        self,
        categories: List[CoreCourseUpdateCategoriesParametersCategoriesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Update categories

        Update categories

        :param categories: (required)
        :type categories: List[CoreCourseUpdateCategoriesParametersCategoriesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_update_categories_serialize(
            categories=categories,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_update_categories_without_preload_content(
        self,
        categories: List[CoreCourseUpdateCategoriesParametersCategoriesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update categories

        Update categories

        :param categories: (required)
        :type categories: List[CoreCourseUpdateCategoriesParametersCategoriesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_update_categories_serialize(
            categories=categories,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_update_categories_serialize(
        self,
        categories,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'categories': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_update_categories'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_update_categories'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_update_categories',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if categories is not None:
            _form_params += parse_form({'categories': categories})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_update_courses_args(
        self,
        courses: Annotated[List[CoreCourseUpdateCoursesParametersCoursesInner], Field(description="courses to update")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update courses

        Update courses

        :param courses: courses to update (required)
        :type courses: List[CoreCourseUpdateCoursesParametersCoursesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_update_courses_serialize(
            courses=courses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseUpdateCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_update_courses(
        self,
        courses: Annotated[List[CoreCourseUpdateCoursesParametersCoursesInner], Field(description="courses to update")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseUpdateCoursesResponse:
        """Update courses

        Update courses

        :param courses: courses to update (required)
        :type courses: List[CoreCourseUpdateCoursesParametersCoursesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_update_courses_serialize(
            courses=courses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseUpdateCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_update_courses_from_args(
        self,
        args
    ) -> CoreCourseUpdateCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseUpdateCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_update_courses_with_http_info(
        self,
        courses: Annotated[List[CoreCourseUpdateCoursesParametersCoursesInner], Field(description="courses to update")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseUpdateCoursesResponse]:
        """Update courses

        Update courses

        :param courses: courses to update (required)
        :type courses: List[CoreCourseUpdateCoursesParametersCoursesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_update_courses_serialize(
            courses=courses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseUpdateCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_update_courses_without_preload_content(
        self,
        courses: Annotated[List[CoreCourseUpdateCoursesParametersCoursesInner], Field(description="courses to update")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update courses

        Update courses

        :param courses: courses to update (required)
        :type courses: List[CoreCourseUpdateCoursesParametersCoursesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_update_courses_serialize(
            courses=courses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseUpdateCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_update_courses_serialize(
        self,
        courses,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courses': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_course_update_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_update_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_update_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courses is not None:
            _form_params += parse_form({'courses': courses})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_course_view_course_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course")],
        sectionnumber: Annotated[Optional[StrictInt], Field(description="section number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Log that the course was viewed

        Log that the course was viewed

        :param courseid: id of the course (required)
        :type courseid: int
        :param sectionnumber: section number
        :type sectionnumber: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_view_course_serialize(
            courseid=courseid,
            sectionnumber=sectionnumber,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseViewCourseResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_course_view_course(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course")],
        sectionnumber: Annotated[Optional[StrictInt], Field(description="section number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCourseViewCourseResponse:
        """Log that the course was viewed

        Log that the course was viewed

        :param courseid: id of the course (required)
        :type courseid: int
        :param sectionnumber: section number
        :type sectionnumber: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_view_course_serialize(
            courseid=courseid,
            sectionnumber=sectionnumber,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseViewCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_view_course_from_args(
        self,
        args
    ) -> CoreCourseViewCourseResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseViewCourseResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_course_view_course_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course")],
        sectionnumber: Annotated[Optional[StrictInt], Field(description="section number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCourseViewCourseResponse]:
        """Log that the course was viewed

        Log that the course was viewed

        :param courseid: id of the course (required)
        :type courseid: int
        :param sectionnumber: section number
        :type sectionnumber: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_view_course_serialize(
            courseid=courseid,
            sectionnumber=sectionnumber,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseViewCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_course_view_course_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course")],
        sectionnumber: Annotated[Optional[StrictInt], Field(description="section number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Log that the course was viewed

        Log that the course was viewed

        :param courseid: id of the course (required)
        :type courseid: int
        :param sectionnumber: section number
        :type sectionnumber: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_course_view_course_serialize(
            courseid=courseid,
            sectionnumber=sectionnumber,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCourseViewCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_course_view_course_serialize(
        self,
        courseid,
        sectionnumber,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_course_view_course'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_course_view_course'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_course_view_course',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if sectionnumber is not None:
            _form_params += parse_form({'sectionnumber': sectionnumber})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_courseformat_create_module_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        modname: Annotated[Optional[StrictStr], Field(description="module name")],
        targetsectionnum: Annotated[Optional[StrictInt], Field(description="target section number")],
        targetcmid: Annotated[Optional[StrictInt], Field(description="Optional target cm id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """** DEPRECATED ** Please do not call this function any more. Use core_courseformat_new_module instead. Add module to course.

        ** DEPRECATED ** Please do not call this function any more. Use core_courseformat_new_module instead. Add module to course.

        :param courseid: course id (required)
        :type courseid: int
        :param modname: module name (required)
        :type modname: str
        :param targetsectionnum: target section number (required)
        :type targetsectionnum: int
        :param targetcmid: Optional target cm id
        :type targetcmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_create_module_serialize(
            courseid=courseid,
            modname=modname,
            targetsectionnum=targetsectionnum,
            targetcmid=targetcmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_courseformat_create_module(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        modname: Annotated[Optional[StrictStr], Field(description="module name")],
        targetsectionnum: Annotated[Optional[StrictInt], Field(description="target section number")],
        targetcmid: Annotated[Optional[StrictInt], Field(description="Optional target cm id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """** DEPRECATED ** Please do not call this function any more. Use core_courseformat_new_module instead. Add module to course.

        ** DEPRECATED ** Please do not call this function any more. Use core_courseformat_new_module instead. Add module to course.

        :param courseid: course id (required)
        :type courseid: int
        :param modname: module name (required)
        :type modname: str
        :param targetsectionnum: target section number (required)
        :type targetsectionnum: int
        :param targetcmid: Optional target cm id
        :type targetcmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_create_module_serialize(
            courseid=courseid,
            modname=modname,
            targetsectionnum=targetsectionnum,
            targetcmid=targetcmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_courseformat_create_module_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_courseformat_create_module_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        modname: Annotated[Optional[StrictStr], Field(description="module name")],
        targetsectionnum: Annotated[Optional[StrictInt], Field(description="target section number")],
        targetcmid: Annotated[Optional[StrictInt], Field(description="Optional target cm id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """** DEPRECATED ** Please do not call this function any more. Use core_courseformat_new_module instead. Add module to course.

        ** DEPRECATED ** Please do not call this function any more. Use core_courseformat_new_module instead. Add module to course.

        :param courseid: course id (required)
        :type courseid: int
        :param modname: module name (required)
        :type modname: str
        :param targetsectionnum: target section number (required)
        :type targetsectionnum: int
        :param targetcmid: Optional target cm id
        :type targetcmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_create_module_serialize(
            courseid=courseid,
            modname=modname,
            targetsectionnum=targetsectionnum,
            targetcmid=targetcmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_courseformat_create_module_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        modname: Annotated[Optional[StrictStr], Field(description="module name")],
        targetsectionnum: Annotated[Optional[StrictInt], Field(description="target section number")],
        targetcmid: Annotated[Optional[StrictInt], Field(description="Optional target cm id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """** DEPRECATED ** Please do not call this function any more. Use core_courseformat_new_module instead. Add module to course.

        ** DEPRECATED ** Please do not call this function any more. Use core_courseformat_new_module instead. Add module to course.

        :param courseid: course id (required)
        :type courseid: int
        :param modname: module name (required)
        :type modname: str
        :param targetsectionnum: target section number (required)
        :type targetsectionnum: int
        :param targetcmid: Optional target cm id
        :type targetcmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_create_module_serialize(
            courseid=courseid,
            modname=modname,
            targetsectionnum=targetsectionnum,
            targetcmid=targetcmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_courseformat_create_module_serialize(
        self,
        courseid,
        modname,
        targetsectionnum,
        targetcmid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_courseformat_create_module'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_courseformat_create_module'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_courseformat_create_module',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if modname is not None:
            _form_params += parse_form({'modname': modname})
        if targetcmid is not None:
            _form_params += parse_form({'targetcmid': targetcmid})
        if targetsectionnum is not None:
            _form_params += parse_form({'targetsectionnum': targetsectionnum})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_courseformat_file_handlers_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the current course file hanlders.

        Get the current course file hanlders.

        :param courseid: course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_file_handlers_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseformatFileHandlersResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_courseformat_file_handlers(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreCourseformatFileHandlersResponseInner]:
        """Get the current course file hanlders.

        Get the current course file hanlders.

        :param courseid: course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_file_handlers_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseformatFileHandlersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_courseformat_file_handlers_from_args(
        self,
        args
    ) -> List[CoreCourseformatFileHandlersResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseformatFileHandlersResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_courseformat_file_handlers_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreCourseformatFileHandlersResponseInner]]:
        """Get the current course file hanlders.

        Get the current course file hanlders.

        :param courseid: course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_file_handlers_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseformatFileHandlersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_courseformat_file_handlers_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the current course file hanlders.

        Get the current course file hanlders.

        :param courseid: course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_file_handlers_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreCourseformatFileHandlersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_courseformat_file_handlers_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_courseformat_file_handlers'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_courseformat_file_handlers'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_courseformat_file_handlers',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_courseformat_get_state_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the current course state.

        Get the current course state.

        :param courseid: course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_get_state_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_courseformat_get_state(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """Get the current course state.

        Get the current course state.

        :param courseid: course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_get_state_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_courseformat_get_state_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_courseformat_get_state_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """Get the current course state.

        Get the current course state.

        :param courseid: course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_get_state_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_courseformat_get_state_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the current course state.

        Get the current course state.

        :param courseid: course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_get_state_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_courseformat_get_state_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_courseformat_get_state'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_courseformat_get_state'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_courseformat_get_state',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_courseformat_new_module_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        modname: Annotated[Optional[StrictStr], Field(description="module name")],
        targetsectionid: Annotated[Optional[StrictInt], Field(description="target section id")],
        targetcmid: Annotated[Optional[StrictInt], Field(description="Optional target cm id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Create a new module to course.

        Create a new module to course.

        :param courseid: course id (required)
        :type courseid: int
        :param modname: module name (required)
        :type modname: str
        :param targetsectionid: target section id (required)
        :type targetsectionid: int
        :param targetcmid: Optional target cm id
        :type targetcmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_new_module_serialize(
            courseid=courseid,
            modname=modname,
            targetsectionid=targetsectionid,
            targetcmid=targetcmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_courseformat_new_module(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        modname: Annotated[Optional[StrictStr], Field(description="module name")],
        targetsectionid: Annotated[Optional[StrictInt], Field(description="target section id")],
        targetcmid: Annotated[Optional[StrictInt], Field(description="Optional target cm id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """Create a new module to course.

        Create a new module to course.

        :param courseid: course id (required)
        :type courseid: int
        :param modname: module name (required)
        :type modname: str
        :param targetsectionid: target section id (required)
        :type targetsectionid: int
        :param targetcmid: Optional target cm id
        :type targetcmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_new_module_serialize(
            courseid=courseid,
            modname=modname,
            targetsectionid=targetsectionid,
            targetcmid=targetcmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_courseformat_new_module_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_courseformat_new_module_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        modname: Annotated[Optional[StrictStr], Field(description="module name")],
        targetsectionid: Annotated[Optional[StrictInt], Field(description="target section id")],
        targetcmid: Annotated[Optional[StrictInt], Field(description="Optional target cm id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """Create a new module to course.

        Create a new module to course.

        :param courseid: course id (required)
        :type courseid: int
        :param modname: module name (required)
        :type modname: str
        :param targetsectionid: target section id (required)
        :type targetsectionid: int
        :param targetcmid: Optional target cm id
        :type targetcmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_new_module_serialize(
            courseid=courseid,
            modname=modname,
            targetsectionid=targetsectionid,
            targetcmid=targetcmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_courseformat_new_module_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        modname: Annotated[Optional[StrictStr], Field(description="module name")],
        targetsectionid: Annotated[Optional[StrictInt], Field(description="target section id")],
        targetcmid: Annotated[Optional[StrictInt], Field(description="Optional target cm id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create a new module to course.

        Create a new module to course.

        :param courseid: course id (required)
        :type courseid: int
        :param modname: module name (required)
        :type modname: str
        :param targetsectionid: target section id (required)
        :type targetsectionid: int
        :param targetcmid: Optional target cm id
        :type targetcmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_new_module_serialize(
            courseid=courseid,
            modname=modname,
            targetsectionid=targetsectionid,
            targetcmid=targetcmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_courseformat_new_module_serialize(
        self,
        courseid,
        modname,
        targetsectionid,
        targetcmid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_courseformat_new_module'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_courseformat_new_module'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_courseformat_new_module',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if modname is not None:
            _form_params += parse_form({'modname': modname})
        if targetcmid is not None:
            _form_params += parse_form({'targetcmid': targetcmid})
        if targetsectionid is not None:
            _form_params += parse_form({'targetsectionid': targetsectionid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_courseformat_update_course_args(
        self,
        action: Annotated[Optional[StrictStr], Field(description="action: cm_hide, cm_show, section_hide, section_show, cm_moveleft...")],
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        ids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Affected ids")] = None,
        targetcmid: Annotated[Optional[StrictInt], Field(description="Optional target cm id")] = None,
        targetsectionid: Annotated[Optional[StrictInt], Field(description="Optional target section id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update course contents.

        Update course contents.

        :param action: action: cm_hide, cm_show, section_hide, section_show, cm_moveleft... (required)
        :type action: str
        :param courseid: course id (required)
        :type courseid: int
        :param ids: Affected ids
        :type ids: List[Optional[int]]
        :param targetcmid: Optional target cm id
        :type targetcmid: int
        :param targetsectionid: Optional target section id
        :type targetsectionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_update_course_serialize(
            action=action,
            courseid=courseid,
            ids=ids,
            targetcmid=targetcmid,
            targetsectionid=targetsectionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_courseformat_update_course(
        self,
        action: Annotated[Optional[StrictStr], Field(description="action: cm_hide, cm_show, section_hide, section_show, cm_moveleft...")],
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        ids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Affected ids")] = None,
        targetcmid: Annotated[Optional[StrictInt], Field(description="Optional target cm id")] = None,
        targetsectionid: Annotated[Optional[StrictInt], Field(description="Optional target section id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """Update course contents.

        Update course contents.

        :param action: action: cm_hide, cm_show, section_hide, section_show, cm_moveleft... (required)
        :type action: str
        :param courseid: course id (required)
        :type courseid: int
        :param ids: Affected ids
        :type ids: List[Optional[int]]
        :param targetcmid: Optional target cm id
        :type targetcmid: int
        :param targetsectionid: Optional target section id
        :type targetsectionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_update_course_serialize(
            action=action,
            courseid=courseid,
            ids=ids,
            targetcmid=targetcmid,
            targetsectionid=targetsectionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_courseformat_update_course_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_courseformat_update_course_with_http_info(
        self,
        action: Annotated[Optional[StrictStr], Field(description="action: cm_hide, cm_show, section_hide, section_show, cm_moveleft...")],
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        ids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Affected ids")] = None,
        targetcmid: Annotated[Optional[StrictInt], Field(description="Optional target cm id")] = None,
        targetsectionid: Annotated[Optional[StrictInt], Field(description="Optional target section id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """Update course contents.

        Update course contents.

        :param action: action: cm_hide, cm_show, section_hide, section_show, cm_moveleft... (required)
        :type action: str
        :param courseid: course id (required)
        :type courseid: int
        :param ids: Affected ids
        :type ids: List[Optional[int]]
        :param targetcmid: Optional target cm id
        :type targetcmid: int
        :param targetsectionid: Optional target section id
        :type targetsectionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_update_course_serialize(
            action=action,
            courseid=courseid,
            ids=ids,
            targetcmid=targetcmid,
            targetsectionid=targetsectionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_courseformat_update_course_without_preload_content(
        self,
        action: Annotated[Optional[StrictStr], Field(description="action: cm_hide, cm_show, section_hide, section_show, cm_moveleft...")],
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        ids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Affected ids")] = None,
        targetcmid: Annotated[Optional[StrictInt], Field(description="Optional target cm id")] = None,
        targetsectionid: Annotated[Optional[StrictInt], Field(description="Optional target section id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update course contents.

        Update course contents.

        :param action: action: cm_hide, cm_show, section_hide, section_show, cm_moveleft... (required)
        :type action: str
        :param courseid: course id (required)
        :type courseid: int
        :param ids: Affected ids
        :type ids: List[Optional[int]]
        :param targetcmid: Optional target cm id
        :type targetcmid: int
        :param targetsectionid: Optional target section id
        :type targetsectionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_courseformat_update_course_serialize(
            action=action,
            courseid=courseid,
            ids=ids,
            targetcmid=targetcmid,
            targetsectionid=targetsectionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_courseformat_update_course_serialize(
        self,
        action,
        courseid,
        ids,
        targetcmid,
        targetsectionid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'ids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_courseformat_update_course'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_courseformat_update_course'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_courseformat_update_course',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if action is not None:
            _form_params += parse_form({'action': action})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if ids is not None:
            _form_params += parse_form({'ids': ids})
        if targetcmid is not None:
            _form_params += parse_form({'targetcmid': targetcmid})
        if targetsectionid is not None:
            _form_params += parse_form({'targetsectionid': targetsectionid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_create_userfeedback_action_record_args(
        self,
        action: Annotated[Optional[StrictStr], Field(description="The action taken by user")],
        contextid: Annotated[Optional[StrictInt], Field(description="The context id of the page the user is in")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Record the action that the user takes in the user feedback notification for future use.

        Record the action that the user takes in the user feedback notification for future use.

        :param action: The action taken by user (required)
        :type action: str
        :param contextid: The context id of the page the user is in (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_create_userfeedback_action_record_serialize(
            action=action,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_create_userfeedback_action_record(
        self,
        action: Annotated[Optional[StrictStr], Field(description="The action taken by user")],
        contextid: Annotated[Optional[StrictInt], Field(description="The context id of the page the user is in")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Record the action that the user takes in the user feedback notification for future use.

        Record the action that the user takes in the user feedback notification for future use.

        :param action: The action taken by user (required)
        :type action: str
        :param contextid: The context id of the page the user is in (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_create_userfeedback_action_record_serialize(
            action=action,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_create_userfeedback_action_record_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_create_userfeedback_action_record_with_http_info(
        self,
        action: Annotated[Optional[StrictStr], Field(description="The action taken by user")],
        contextid: Annotated[Optional[StrictInt], Field(description="The context id of the page the user is in")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Record the action that the user takes in the user feedback notification for future use.

        Record the action that the user takes in the user feedback notification for future use.

        :param action: The action taken by user (required)
        :type action: str
        :param contextid: The context id of the page the user is in (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_create_userfeedback_action_record_serialize(
            action=action,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_create_userfeedback_action_record_without_preload_content(
        self,
        action: Annotated[Optional[StrictStr], Field(description="The action taken by user")],
        contextid: Annotated[Optional[StrictInt], Field(description="The context id of the page the user is in")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Record the action that the user takes in the user feedback notification for future use.

        Record the action that the user takes in the user feedback notification for future use.

        :param action: The action taken by user (required)
        :type action: str
        :param contextid: The context id of the page the user is in (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_create_userfeedback_action_record_serialize(
            action=action,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_create_userfeedback_action_record_serialize(
        self,
        action,
        contextid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_create_userfeedback_action_record'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_create_userfeedback_action_record'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_create_userfeedback_action_record',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if action is not None:
            _form_params += parse_form({'action': action})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_customfield_create_category_args(
        self,
        area: Annotated[Optional[StrictStr], Field(description="area")],
        component: Annotated[Optional[StrictStr], Field(description="component")],
        itemid: Annotated[Optional[StrictInt], Field(description="itemid")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Creates a new category

        Creates a new category

        :param area: area (required)
        :type area: str
        :param component: component (required)
        :type component: str
        :param itemid: itemid (required)
        :type itemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_create_category_serialize(
            area=area,
            component=component,
            itemid=itemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_customfield_create_category(
        self,
        area: Annotated[Optional[StrictStr], Field(description="area")],
        component: Annotated[Optional[StrictStr], Field(description="component")],
        itemid: Annotated[Optional[StrictInt], Field(description="itemid")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> int:
        """Creates a new category

        Creates a new category

        :param area: area (required)
        :type area: str
        :param component: component (required)
        :type component: str
        :param itemid: itemid (required)
        :type itemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_create_category_serialize(
            area=area,
            component=component,
            itemid=itemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_customfield_create_category_from_args(
        self,
        args
    ) -> int:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_customfield_create_category_with_http_info(
        self,
        area: Annotated[Optional[StrictStr], Field(description="area")],
        component: Annotated[Optional[StrictStr], Field(description="component")],
        itemid: Annotated[Optional[StrictInt], Field(description="itemid")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[int]:
        """Creates a new category

        Creates a new category

        :param area: area (required)
        :type area: str
        :param component: component (required)
        :type component: str
        :param itemid: itemid (required)
        :type itemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_create_category_serialize(
            area=area,
            component=component,
            itemid=itemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_customfield_create_category_without_preload_content(
        self,
        area: Annotated[Optional[StrictStr], Field(description="area")],
        component: Annotated[Optional[StrictStr], Field(description="component")],
        itemid: Annotated[Optional[StrictInt], Field(description="itemid")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Creates a new category

        Creates a new category

        :param area: area (required)
        :type area: str
        :param component: component (required)
        :type component: str
        :param itemid: itemid (required)
        :type itemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_create_category_serialize(
            area=area,
            component=component,
            itemid=itemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_customfield_create_category_serialize(
        self,
        area,
        component,
        itemid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_customfield_create_category'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_customfield_create_category'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_customfield_create_category',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if area is not None:
            _form_params += parse_form({'area': area})
        if component is not None:
            _form_params += parse_form({'component': component})
        if itemid is not None:
            _form_params += parse_form({'itemid': itemid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_customfield_delete_category_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="category ID to delete")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes a category

        Deletes a category

        :param id: category ID to delete (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_delete_category_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_customfield_delete_category(
        self,
        id: Annotated[Optional[StrictInt], Field(description="category ID to delete")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Deletes a category

        Deletes a category

        :param id: category ID to delete (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_delete_category_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_customfield_delete_category_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_customfield_delete_category_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="category ID to delete")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Deletes a category

        Deletes a category

        :param id: category ID to delete (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_delete_category_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_customfield_delete_category_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="category ID to delete")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes a category

        Deletes a category

        :param id: category ID to delete (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_delete_category_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_customfield_delete_category_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_customfield_delete_category'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_customfield_delete_category'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_customfield_delete_category',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_customfield_delete_field_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Custom field ID to delete")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes an entry

        Deletes an entry

        :param id: Custom field ID to delete (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_delete_field_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_customfield_delete_field(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Custom field ID to delete")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Deletes an entry

        Deletes an entry

        :param id: Custom field ID to delete (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_delete_field_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_customfield_delete_field_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_customfield_delete_field_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Custom field ID to delete")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Deletes an entry

        Deletes an entry

        :param id: Custom field ID to delete (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_delete_field_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_customfield_delete_field_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Custom field ID to delete")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes an entry

        Deletes an entry

        :param id: Custom field ID to delete (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_delete_field_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_customfield_delete_field_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_customfield_delete_field'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_customfield_delete_field'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_customfield_delete_field',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_customfield_move_category_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Category ID to move")],
        beforeid: Annotated[Optional[StrictInt], Field(description="Id of the category before which it needs to be moved")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Drag and drop categories

        Drag and drop categories

        :param id: Category ID to move (required)
        :type id: int
        :param beforeid: Id of the category before which it needs to be moved
        :type beforeid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_move_category_serialize(
            id=id,
            beforeid=beforeid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_customfield_move_category(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Category ID to move")],
        beforeid: Annotated[Optional[StrictInt], Field(description="Id of the category before which it needs to be moved")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Drag and drop categories

        Drag and drop categories

        :param id: Category ID to move (required)
        :type id: int
        :param beforeid: Id of the category before which it needs to be moved
        :type beforeid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_move_category_serialize(
            id=id,
            beforeid=beforeid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_customfield_move_category_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_customfield_move_category_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Category ID to move")],
        beforeid: Annotated[Optional[StrictInt], Field(description="Id of the category before which it needs to be moved")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Drag and drop categories

        Drag and drop categories

        :param id: Category ID to move (required)
        :type id: int
        :param beforeid: Id of the category before which it needs to be moved
        :type beforeid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_move_category_serialize(
            id=id,
            beforeid=beforeid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_customfield_move_category_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Category ID to move")],
        beforeid: Annotated[Optional[StrictInt], Field(description="Id of the category before which it needs to be moved")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Drag and drop categories

        Drag and drop categories

        :param id: Category ID to move (required)
        :type id: int
        :param beforeid: Id of the category before which it needs to be moved
        :type beforeid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_move_category_serialize(
            id=id,
            beforeid=beforeid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_customfield_move_category_serialize(
        self,
        id,
        beforeid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_customfield_move_category'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_customfield_move_category'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_customfield_move_category',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if beforeid is not None:
            _form_params += parse_form({'beforeid': beforeid})
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_customfield_move_field_args(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="New parent category id")],
        id: Annotated[Optional[StrictInt], Field(description="Id of the field to move")],
        beforeid: Annotated[Optional[StrictInt], Field(description="Id of the field before which it needs to be moved")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Drag and drop

        Drag and drop

        :param categoryid: New parent category id (required)
        :type categoryid: int
        :param id: Id of the field to move (required)
        :type id: int
        :param beforeid: Id of the field before which it needs to be moved
        :type beforeid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_move_field_serialize(
            categoryid=categoryid,
            id=id,
            beforeid=beforeid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_customfield_move_field(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="New parent category id")],
        id: Annotated[Optional[StrictInt], Field(description="Id of the field to move")],
        beforeid: Annotated[Optional[StrictInt], Field(description="Id of the field before which it needs to be moved")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Drag and drop

        Drag and drop

        :param categoryid: New parent category id (required)
        :type categoryid: int
        :param id: Id of the field to move (required)
        :type id: int
        :param beforeid: Id of the field before which it needs to be moved
        :type beforeid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_move_field_serialize(
            categoryid=categoryid,
            id=id,
            beforeid=beforeid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_customfield_move_field_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_customfield_move_field_with_http_info(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="New parent category id")],
        id: Annotated[Optional[StrictInt], Field(description="Id of the field to move")],
        beforeid: Annotated[Optional[StrictInt], Field(description="Id of the field before which it needs to be moved")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Drag and drop

        Drag and drop

        :param categoryid: New parent category id (required)
        :type categoryid: int
        :param id: Id of the field to move (required)
        :type id: int
        :param beforeid: Id of the field before which it needs to be moved
        :type beforeid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_move_field_serialize(
            categoryid=categoryid,
            id=id,
            beforeid=beforeid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_customfield_move_field_without_preload_content(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="New parent category id")],
        id: Annotated[Optional[StrictInt], Field(description="Id of the field to move")],
        beforeid: Annotated[Optional[StrictInt], Field(description="Id of the field before which it needs to be moved")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Drag and drop

        Drag and drop

        :param categoryid: New parent category id (required)
        :type categoryid: int
        :param id: Id of the field to move (required)
        :type id: int
        :param beforeid: Id of the field before which it needs to be moved
        :type beforeid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_move_field_serialize(
            categoryid=categoryid,
            id=id,
            beforeid=beforeid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_customfield_move_field_serialize(
        self,
        categoryid,
        id,
        beforeid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_customfield_move_field'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_customfield_move_field'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_customfield_move_field',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if beforeid is not None:
            _form_params += parse_form({'beforeid': beforeid})
        if categoryid is not None:
            _form_params += parse_form({'categoryid': categoryid})
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_customfield_reload_template_args(
        self,
        area: Annotated[Optional[StrictStr], Field(description="area")],
        component: Annotated[Optional[StrictStr], Field(description="component")],
        itemid: Annotated[Optional[StrictInt], Field(description="itemid")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Reloads template

        Reloads template

        :param area: area (required)
        :type area: str
        :param component: component (required)
        :type component: str
        :param itemid: itemid (required)
        :type itemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_reload_template_serialize(
            area=area,
            component=component,
            itemid=itemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCustomfieldReloadTemplateResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_customfield_reload_template(
        self,
        area: Annotated[Optional[StrictStr], Field(description="area")],
        component: Annotated[Optional[StrictStr], Field(description="component")],
        itemid: Annotated[Optional[StrictInt], Field(description="itemid")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreCustomfieldReloadTemplateResponse:
        """Reloads template

        Reloads template

        :param area: area (required)
        :type area: str
        :param component: component (required)
        :type component: str
        :param itemid: itemid (required)
        :type itemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_reload_template_serialize(
            area=area,
            component=component,
            itemid=itemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCustomfieldReloadTemplateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_customfield_reload_template_from_args(
        self,
        args
    ) -> CoreCustomfieldReloadTemplateResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCustomfieldReloadTemplateResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_customfield_reload_template_with_http_info(
        self,
        area: Annotated[Optional[StrictStr], Field(description="area")],
        component: Annotated[Optional[StrictStr], Field(description="component")],
        itemid: Annotated[Optional[StrictInt], Field(description="itemid")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreCustomfieldReloadTemplateResponse]:
        """Reloads template

        Reloads template

        :param area: area (required)
        :type area: str
        :param component: component (required)
        :type component: str
        :param itemid: itemid (required)
        :type itemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_reload_template_serialize(
            area=area,
            component=component,
            itemid=itemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCustomfieldReloadTemplateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_customfield_reload_template_without_preload_content(
        self,
        area: Annotated[Optional[StrictStr], Field(description="area")],
        component: Annotated[Optional[StrictStr], Field(description="component")],
        itemid: Annotated[Optional[StrictInt], Field(description="itemid")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Reloads template

        Reloads template

        :param area: area (required)
        :type area: str
        :param component: component (required)
        :type component: str
        :param itemid: itemid (required)
        :type itemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_customfield_reload_template_serialize(
            area=area,
            component=component,
            itemid=itemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreCustomfieldReloadTemplateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_customfield_reload_template_serialize(
        self,
        area,
        component,
        itemid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_customfield_reload_template'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_customfield_reload_template'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_customfield_reload_template',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if area is not None:
            _form_params += parse_form({'area': area})
        if component is not None:
            _form_params += parse_form({'component': component})
        if itemid is not None:
            _form_params += parse_form({'itemid': itemid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_dynamic_tabs_get_content_args(
        self,
        jsondata: Annotated[Optional[StrictStr], Field(description="Json-encoded data")],
        tab: Annotated[Optional[StrictStr], Field(description="Tab class")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the content for a dynamic tab

        Returns the content for a dynamic tab

        :param jsondata: Json-encoded data (required)
        :type jsondata: str
        :param tab: Tab class (required)
        :type tab: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_dynamic_tabs_get_content_serialize(
            jsondata=jsondata,
            tab=tab,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreDynamicTabsGetContentResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_dynamic_tabs_get_content(
        self,
        jsondata: Annotated[Optional[StrictStr], Field(description="Json-encoded data")],
        tab: Annotated[Optional[StrictStr], Field(description="Tab class")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreDynamicTabsGetContentResponse:
        """Returns the content for a dynamic tab

        Returns the content for a dynamic tab

        :param jsondata: Json-encoded data (required)
        :type jsondata: str
        :param tab: Tab class (required)
        :type tab: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_dynamic_tabs_get_content_serialize(
            jsondata=jsondata,
            tab=tab,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreDynamicTabsGetContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_dynamic_tabs_get_content_from_args(
        self,
        args
    ) -> CoreDynamicTabsGetContentResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreDynamicTabsGetContentResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_dynamic_tabs_get_content_with_http_info(
        self,
        jsondata: Annotated[Optional[StrictStr], Field(description="Json-encoded data")],
        tab: Annotated[Optional[StrictStr], Field(description="Tab class")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreDynamicTabsGetContentResponse]:
        """Returns the content for a dynamic tab

        Returns the content for a dynamic tab

        :param jsondata: Json-encoded data (required)
        :type jsondata: str
        :param tab: Tab class (required)
        :type tab: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_dynamic_tabs_get_content_serialize(
            jsondata=jsondata,
            tab=tab,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreDynamicTabsGetContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_dynamic_tabs_get_content_without_preload_content(
        self,
        jsondata: Annotated[Optional[StrictStr], Field(description="Json-encoded data")],
        tab: Annotated[Optional[StrictStr], Field(description="Tab class")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the content for a dynamic tab

        Returns the content for a dynamic tab

        :param jsondata: Json-encoded data (required)
        :type jsondata: str
        :param tab: Tab class (required)
        :type tab: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_dynamic_tabs_get_content_serialize(
            jsondata=jsondata,
            tab=tab,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreDynamicTabsGetContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_dynamic_tabs_get_content_serialize(
        self,
        jsondata,
        tab,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_dynamic_tabs_get_content'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_dynamic_tabs_get_content'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_dynamic_tabs_get_content',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if jsondata is not None:
            _form_params += parse_form({'jsondata': jsondata})
        if tab is not None:
            _form_params += parse_form({'tab': tab})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_enrol_get_course_enrolment_methods_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the list of course enrolment methods

        Get the list of course enrolment methods

        :param courseid: Course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_course_enrolment_methods_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetCourseEnrolmentMethodsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_enrol_get_course_enrolment_methods(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreEnrolGetCourseEnrolmentMethodsResponseInner]:
        """Get the list of course enrolment methods

        Get the list of course enrolment methods

        :param courseid: Course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_course_enrolment_methods_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetCourseEnrolmentMethodsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_enrol_get_course_enrolment_methods_from_args(
        self,
        args
    ) -> List[CoreEnrolGetCourseEnrolmentMethodsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetCourseEnrolmentMethodsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_enrol_get_course_enrolment_methods_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreEnrolGetCourseEnrolmentMethodsResponseInner]]:
        """Get the list of course enrolment methods

        Get the list of course enrolment methods

        :param courseid: Course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_course_enrolment_methods_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetCourseEnrolmentMethodsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_enrol_get_course_enrolment_methods_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the list of course enrolment methods

        Get the list of course enrolment methods

        :param courseid: Course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_course_enrolment_methods_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetCourseEnrolmentMethodsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_enrol_get_course_enrolment_methods_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_enrol_get_course_enrolment_methods'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_enrol_get_course_enrolment_methods'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_enrol_get_course_enrolment_methods',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_enrol_get_enrolled_users_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        options: Annotated[Optional[List[CoreEnrolGetEnrolledUsersParametersOptionsInner]], Field(description="Option names:                             * withcapability (string) return only users with this capability. This option requires 'moodle/role:review' on the course context.                             * groupid (integer) return only users in this group id. If the course has groups enabled and this param                                                 isn't defined, returns all the viewable users.                                                 This option requires 'moodle/site:accessallgroups' on the course context if the                                                 user doesn't belong to the group.                             * onlyactive (integer) return only users with active enrolments and matching time restrictions.                                                 This option requires 'moodle/course:enrolreview' on the course context.                                                 Please note that this option can't                                                 be used together with onlysuspended (only one can be active).                             * onlysuspended (integer) return only suspended users. This option requires                                             'moodle/course:enrolreview' on the course context. Please note that this option can't                                                 be used together with onlyactive (only one can be active).                             * userfields ('string, string, ...') return only the values of these user fields.                             * limitfrom (integer) sql limit from.                             * limitnumber (integer) maximum number of returned users.                             * sortby (string) sort by id, firstname or lastname. For ordering like the site does, use siteorder.                             * sortdirection (string) ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get enrolled users by course id.

        Get enrolled users by course id.

        :param courseid: course id (required)
        :type courseid: int
        :param options: Option names:                             * withcapability (string) return only users with this capability. This option requires 'moodle/role:review' on the course context.                             * groupid (integer) return only users in this group id. If the course has groups enabled and this param                                                 isn't defined, returns all the viewable users.                                                 This option requires 'moodle/site:accessallgroups' on the course context if the                                                 user doesn't belong to the group.                             * onlyactive (integer) return only users with active enrolments and matching time restrictions.                                                 This option requires 'moodle/course:enrolreview' on the course context.                                                 Please note that this option can't                                                 be used together with onlysuspended (only one can be active).                             * onlysuspended (integer) return only suspended users. This option requires                                             'moodle/course:enrolreview' on the course context. Please note that this option can't                                                 be used together with onlyactive (only one can be active).                             * userfields ('string, string, ...') return only the values of these user fields.                             * limitfrom (integer) sql limit from.                             * limitnumber (integer) maximum number of returned users.                             * sortby (string) sort by id, firstname or lastname. For ordering like the site does, use siteorder.                             * sortdirection (string) ASC or DESC
        :type options: List[CoreEnrolGetEnrolledUsersParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_enrolled_users_serialize(
            courseid=courseid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetEnrolledUsersResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_enrol_get_enrolled_users(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        options: Annotated[Optional[List[CoreEnrolGetEnrolledUsersParametersOptionsInner]], Field(description="Option names:                             * withcapability (string) return only users with this capability. This option requires 'moodle/role:review' on the course context.                             * groupid (integer) return only users in this group id. If the course has groups enabled and this param                                                 isn't defined, returns all the viewable users.                                                 This option requires 'moodle/site:accessallgroups' on the course context if the                                                 user doesn't belong to the group.                             * onlyactive (integer) return only users with active enrolments and matching time restrictions.                                                 This option requires 'moodle/course:enrolreview' on the course context.                                                 Please note that this option can't                                                 be used together with onlysuspended (only one can be active).                             * onlysuspended (integer) return only suspended users. This option requires                                             'moodle/course:enrolreview' on the course context. Please note that this option can't                                                 be used together with onlyactive (only one can be active).                             * userfields ('string, string, ...') return only the values of these user fields.                             * limitfrom (integer) sql limit from.                             * limitnumber (integer) maximum number of returned users.                             * sortby (string) sort by id, firstname or lastname. For ordering like the site does, use siteorder.                             * sortdirection (string) ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreEnrolGetEnrolledUsersResponseInner]:
        """Get enrolled users by course id.

        Get enrolled users by course id.

        :param courseid: course id (required)
        :type courseid: int
        :param options: Option names:                             * withcapability (string) return only users with this capability. This option requires 'moodle/role:review' on the course context.                             * groupid (integer) return only users in this group id. If the course has groups enabled and this param                                                 isn't defined, returns all the viewable users.                                                 This option requires 'moodle/site:accessallgroups' on the course context if the                                                 user doesn't belong to the group.                             * onlyactive (integer) return only users with active enrolments and matching time restrictions.                                                 This option requires 'moodle/course:enrolreview' on the course context.                                                 Please note that this option can't                                                 be used together with onlysuspended (only one can be active).                             * onlysuspended (integer) return only suspended users. This option requires                                             'moodle/course:enrolreview' on the course context. Please note that this option can't                                                 be used together with onlyactive (only one can be active).                             * userfields ('string, string, ...') return only the values of these user fields.                             * limitfrom (integer) sql limit from.                             * limitnumber (integer) maximum number of returned users.                             * sortby (string) sort by id, firstname or lastname. For ordering like the site does, use siteorder.                             * sortdirection (string) ASC or DESC
        :type options: List[CoreEnrolGetEnrolledUsersParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_enrolled_users_serialize(
            courseid=courseid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetEnrolledUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_enrol_get_enrolled_users_from_args(
        self,
        args
    ) -> List[CoreEnrolGetEnrolledUsersResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetEnrolledUsersResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_enrol_get_enrolled_users_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        options: Annotated[Optional[List[CoreEnrolGetEnrolledUsersParametersOptionsInner]], Field(description="Option names:                             * withcapability (string) return only users with this capability. This option requires 'moodle/role:review' on the course context.                             * groupid (integer) return only users in this group id. If the course has groups enabled and this param                                                 isn't defined, returns all the viewable users.                                                 This option requires 'moodle/site:accessallgroups' on the course context if the                                                 user doesn't belong to the group.                             * onlyactive (integer) return only users with active enrolments and matching time restrictions.                                                 This option requires 'moodle/course:enrolreview' on the course context.                                                 Please note that this option can't                                                 be used together with onlysuspended (only one can be active).                             * onlysuspended (integer) return only suspended users. This option requires                                             'moodle/course:enrolreview' on the course context. Please note that this option can't                                                 be used together with onlyactive (only one can be active).                             * userfields ('string, string, ...') return only the values of these user fields.                             * limitfrom (integer) sql limit from.                             * limitnumber (integer) maximum number of returned users.                             * sortby (string) sort by id, firstname or lastname. For ordering like the site does, use siteorder.                             * sortdirection (string) ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreEnrolGetEnrolledUsersResponseInner]]:
        """Get enrolled users by course id.

        Get enrolled users by course id.

        :param courseid: course id (required)
        :type courseid: int
        :param options: Option names:                             * withcapability (string) return only users with this capability. This option requires 'moodle/role:review' on the course context.                             * groupid (integer) return only users in this group id. If the course has groups enabled and this param                                                 isn't defined, returns all the viewable users.                                                 This option requires 'moodle/site:accessallgroups' on the course context if the                                                 user doesn't belong to the group.                             * onlyactive (integer) return only users with active enrolments and matching time restrictions.                                                 This option requires 'moodle/course:enrolreview' on the course context.                                                 Please note that this option can't                                                 be used together with onlysuspended (only one can be active).                             * onlysuspended (integer) return only suspended users. This option requires                                             'moodle/course:enrolreview' on the course context. Please note that this option can't                                                 be used together with onlyactive (only one can be active).                             * userfields ('string, string, ...') return only the values of these user fields.                             * limitfrom (integer) sql limit from.                             * limitnumber (integer) maximum number of returned users.                             * sortby (string) sort by id, firstname or lastname. For ordering like the site does, use siteorder.                             * sortdirection (string) ASC or DESC
        :type options: List[CoreEnrolGetEnrolledUsersParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_enrolled_users_serialize(
            courseid=courseid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetEnrolledUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_enrol_get_enrolled_users_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        options: Annotated[Optional[List[CoreEnrolGetEnrolledUsersParametersOptionsInner]], Field(description="Option names:                             * withcapability (string) return only users with this capability. This option requires 'moodle/role:review' on the course context.                             * groupid (integer) return only users in this group id. If the course has groups enabled and this param                                                 isn't defined, returns all the viewable users.                                                 This option requires 'moodle/site:accessallgroups' on the course context if the                                                 user doesn't belong to the group.                             * onlyactive (integer) return only users with active enrolments and matching time restrictions.                                                 This option requires 'moodle/course:enrolreview' on the course context.                                                 Please note that this option can't                                                 be used together with onlysuspended (only one can be active).                             * onlysuspended (integer) return only suspended users. This option requires                                             'moodle/course:enrolreview' on the course context. Please note that this option can't                                                 be used together with onlyactive (only one can be active).                             * userfields ('string, string, ...') return only the values of these user fields.                             * limitfrom (integer) sql limit from.                             * limitnumber (integer) maximum number of returned users.                             * sortby (string) sort by id, firstname or lastname. For ordering like the site does, use siteorder.                             * sortdirection (string) ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get enrolled users by course id.

        Get enrolled users by course id.

        :param courseid: course id (required)
        :type courseid: int
        :param options: Option names:                             * withcapability (string) return only users with this capability. This option requires 'moodle/role:review' on the course context.                             * groupid (integer) return only users in this group id. If the course has groups enabled and this param                                                 isn't defined, returns all the viewable users.                                                 This option requires 'moodle/site:accessallgroups' on the course context if the                                                 user doesn't belong to the group.                             * onlyactive (integer) return only users with active enrolments and matching time restrictions.                                                 This option requires 'moodle/course:enrolreview' on the course context.                                                 Please note that this option can't                                                 be used together with onlysuspended (only one can be active).                             * onlysuspended (integer) return only suspended users. This option requires                                             'moodle/course:enrolreview' on the course context. Please note that this option can't                                                 be used together with onlyactive (only one can be active).                             * userfields ('string, string, ...') return only the values of these user fields.                             * limitfrom (integer) sql limit from.                             * limitnumber (integer) maximum number of returned users.                             * sortby (string) sort by id, firstname or lastname. For ordering like the site does, use siteorder.                             * sortdirection (string) ASC or DESC
        :type options: List[CoreEnrolGetEnrolledUsersParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_enrolled_users_serialize(
            courseid=courseid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetEnrolledUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_enrol_get_enrolled_users_serialize(
        self,
        courseid,
        options,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'options': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_enrol_get_enrolled_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_enrol_get_enrolled_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_enrol_get_enrolled_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if options is not None:
            _form_params += parse_form({'options': options})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_enrol_get_enrolled_users_with_capability_args(
        self,
        coursecapabilities: Annotated[List[CoreEnrolGetEnrolledUsersWithCapabilityParametersCoursecapabilitiesInner], Field(description="course id and associated capability name")],
        options: Annotated[Optional[List[CoreEnrolGetEnrolledUsersParametersOptionsInner]], Field(description="Option names:                             * groupid (integer) return only users in this group id. Requires 'moodle/site:accessallgroups' .                             * onlyactive (integer) only users with active enrolments. Requires 'moodle/course:enrolreview' .                             * userfields ('string, string, ...') return only the values of these user fields.                             * limitfrom (integer) sql limit from.                             * limitnumber (integer) max number of users per course and capability.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """For each course and capability specified, return a list of the users that are enrolled in the course                                   and have that capability

        For each course and capability specified, return a list of the users that are enrolled in the course                                   and have that capability

        :param coursecapabilities: course id and associated capability name (required)
        :type coursecapabilities: List[CoreEnrolGetEnrolledUsersWithCapabilityParametersCoursecapabilitiesInner]
        :param options: Option names:                             * groupid (integer) return only users in this group id. Requires 'moodle/site:accessallgroups' .                             * onlyactive (integer) only users with active enrolments. Requires 'moodle/course:enrolreview' .                             * userfields ('string, string, ...') return only the values of these user fields.                             * limitfrom (integer) sql limit from.                             * limitnumber (integer) max number of users per course and capability.
        :type options: List[CoreEnrolGetEnrolledUsersParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_enrolled_users_with_capability_serialize(
            coursecapabilities=coursecapabilities,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetEnrolledUsersWithCapabilityResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_enrol_get_enrolled_users_with_capability(
        self,
        coursecapabilities: Annotated[List[CoreEnrolGetEnrolledUsersWithCapabilityParametersCoursecapabilitiesInner], Field(description="course id and associated capability name")],
        options: Annotated[Optional[List[CoreEnrolGetEnrolledUsersParametersOptionsInner]], Field(description="Option names:                             * groupid (integer) return only users in this group id. Requires 'moodle/site:accessallgroups' .                             * onlyactive (integer) only users with active enrolments. Requires 'moodle/course:enrolreview' .                             * userfields ('string, string, ...') return only the values of these user fields.                             * limitfrom (integer) sql limit from.                             * limitnumber (integer) max number of users per course and capability.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreEnrolGetEnrolledUsersWithCapabilityResponseInner]:
        """For each course and capability specified, return a list of the users that are enrolled in the course                                   and have that capability

        For each course and capability specified, return a list of the users that are enrolled in the course                                   and have that capability

        :param coursecapabilities: course id and associated capability name (required)
        :type coursecapabilities: List[CoreEnrolGetEnrolledUsersWithCapabilityParametersCoursecapabilitiesInner]
        :param options: Option names:                             * groupid (integer) return only users in this group id. Requires 'moodle/site:accessallgroups' .                             * onlyactive (integer) only users with active enrolments. Requires 'moodle/course:enrolreview' .                             * userfields ('string, string, ...') return only the values of these user fields.                             * limitfrom (integer) sql limit from.                             * limitnumber (integer) max number of users per course and capability.
        :type options: List[CoreEnrolGetEnrolledUsersParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_enrolled_users_with_capability_serialize(
            coursecapabilities=coursecapabilities,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetEnrolledUsersWithCapabilityResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_enrol_get_enrolled_users_with_capability_from_args(
        self,
        args
    ) -> List[CoreEnrolGetEnrolledUsersWithCapabilityResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetEnrolledUsersWithCapabilityResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_enrol_get_enrolled_users_with_capability_with_http_info(
        self,
        coursecapabilities: Annotated[List[CoreEnrolGetEnrolledUsersWithCapabilityParametersCoursecapabilitiesInner], Field(description="course id and associated capability name")],
        options: Annotated[Optional[List[CoreEnrolGetEnrolledUsersParametersOptionsInner]], Field(description="Option names:                             * groupid (integer) return only users in this group id. Requires 'moodle/site:accessallgroups' .                             * onlyactive (integer) only users with active enrolments. Requires 'moodle/course:enrolreview' .                             * userfields ('string, string, ...') return only the values of these user fields.                             * limitfrom (integer) sql limit from.                             * limitnumber (integer) max number of users per course and capability.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreEnrolGetEnrolledUsersWithCapabilityResponseInner]]:
        """For each course and capability specified, return a list of the users that are enrolled in the course                                   and have that capability

        For each course and capability specified, return a list of the users that are enrolled in the course                                   and have that capability

        :param coursecapabilities: course id and associated capability name (required)
        :type coursecapabilities: List[CoreEnrolGetEnrolledUsersWithCapabilityParametersCoursecapabilitiesInner]
        :param options: Option names:                             * groupid (integer) return only users in this group id. Requires 'moodle/site:accessallgroups' .                             * onlyactive (integer) only users with active enrolments. Requires 'moodle/course:enrolreview' .                             * userfields ('string, string, ...') return only the values of these user fields.                             * limitfrom (integer) sql limit from.                             * limitnumber (integer) max number of users per course and capability.
        :type options: List[CoreEnrolGetEnrolledUsersParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_enrolled_users_with_capability_serialize(
            coursecapabilities=coursecapabilities,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetEnrolledUsersWithCapabilityResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_enrol_get_enrolled_users_with_capability_without_preload_content(
        self,
        coursecapabilities: Annotated[List[CoreEnrolGetEnrolledUsersWithCapabilityParametersCoursecapabilitiesInner], Field(description="course id and associated capability name")],
        options: Annotated[Optional[List[CoreEnrolGetEnrolledUsersParametersOptionsInner]], Field(description="Option names:                             * groupid (integer) return only users in this group id. Requires 'moodle/site:accessallgroups' .                             * onlyactive (integer) only users with active enrolments. Requires 'moodle/course:enrolreview' .                             * userfields ('string, string, ...') return only the values of these user fields.                             * limitfrom (integer) sql limit from.                             * limitnumber (integer) max number of users per course and capability.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """For each course and capability specified, return a list of the users that are enrolled in the course                                   and have that capability

        For each course and capability specified, return a list of the users that are enrolled in the course                                   and have that capability

        :param coursecapabilities: course id and associated capability name (required)
        :type coursecapabilities: List[CoreEnrolGetEnrolledUsersWithCapabilityParametersCoursecapabilitiesInner]
        :param options: Option names:                             * groupid (integer) return only users in this group id. Requires 'moodle/site:accessallgroups' .                             * onlyactive (integer) only users with active enrolments. Requires 'moodle/course:enrolreview' .                             * userfields ('string, string, ...') return only the values of these user fields.                             * limitfrom (integer) sql limit from.                             * limitnumber (integer) max number of users per course and capability.
        :type options: List[CoreEnrolGetEnrolledUsersParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_enrolled_users_with_capability_serialize(
            coursecapabilities=coursecapabilities,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetEnrolledUsersWithCapabilityResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_enrol_get_enrolled_users_with_capability_serialize(
        self,
        coursecapabilities,
        options,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'coursecapabilities': 'csv',
            'options': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_enrol_get_enrolled_users_with_capability'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_enrol_get_enrolled_users_with_capability'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_enrol_get_enrolled_users_with_capability',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if coursecapabilities is not None:
            _form_params += parse_form({'coursecapabilities': coursecapabilities})
        if options is not None:
            _form_params += parse_form({'options': options})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_enrol_get_potential_users_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        enrolid: Annotated[Optional[StrictInt], Field(description="enrolment id")],
        page: Annotated[Optional[StrictInt], Field(description="Page number")],
        perpage: Annotated[Optional[StrictInt], Field(description="Number per page")],
        search: Annotated[Optional[StrictStr], Field(description="query")],
        searchanywhere: Annotated[Optional[StrictBool], Field(description="find a match anywhere, or only at the beginning")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the list of potential users to enrol

        Get the list of potential users to enrol

        :param courseid: course id (required)
        :type courseid: int
        :param enrolid: enrolment id (required)
        :type enrolid: int
        :param page: Page number (required)
        :type page: int
        :param perpage: Number per page (required)
        :type perpage: int
        :param search: query (required)
        :type search: str
        :param searchanywhere: find a match anywhere, or only at the beginning (required)
        :type searchanywhere: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_potential_users_serialize(
            courseid=courseid,
            enrolid=enrolid,
            page=page,
            perpage=perpage,
            search=search,
            searchanywhere=searchanywhere,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetPotentialUsersResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_enrol_get_potential_users(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        enrolid: Annotated[Optional[StrictInt], Field(description="enrolment id")],
        page: Annotated[Optional[StrictInt], Field(description="Page number")],
        perpage: Annotated[Optional[StrictInt], Field(description="Number per page")],
        search: Annotated[Optional[StrictStr], Field(description="query")],
        searchanywhere: Annotated[Optional[StrictBool], Field(description="find a match anywhere, or only at the beginning")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreEnrolGetPotentialUsersResponseInner]:
        """Get the list of potential users to enrol

        Get the list of potential users to enrol

        :param courseid: course id (required)
        :type courseid: int
        :param enrolid: enrolment id (required)
        :type enrolid: int
        :param page: Page number (required)
        :type page: int
        :param perpage: Number per page (required)
        :type perpage: int
        :param search: query (required)
        :type search: str
        :param searchanywhere: find a match anywhere, or only at the beginning (required)
        :type searchanywhere: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_potential_users_serialize(
            courseid=courseid,
            enrolid=enrolid,
            page=page,
            perpage=perpage,
            search=search,
            searchanywhere=searchanywhere,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetPotentialUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_enrol_get_potential_users_from_args(
        self,
        args
    ) -> List[CoreEnrolGetPotentialUsersResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetPotentialUsersResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_enrol_get_potential_users_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        enrolid: Annotated[Optional[StrictInt], Field(description="enrolment id")],
        page: Annotated[Optional[StrictInt], Field(description="Page number")],
        perpage: Annotated[Optional[StrictInt], Field(description="Number per page")],
        search: Annotated[Optional[StrictStr], Field(description="query")],
        searchanywhere: Annotated[Optional[StrictBool], Field(description="find a match anywhere, or only at the beginning")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreEnrolGetPotentialUsersResponseInner]]:
        """Get the list of potential users to enrol

        Get the list of potential users to enrol

        :param courseid: course id (required)
        :type courseid: int
        :param enrolid: enrolment id (required)
        :type enrolid: int
        :param page: Page number (required)
        :type page: int
        :param perpage: Number per page (required)
        :type perpage: int
        :param search: query (required)
        :type search: str
        :param searchanywhere: find a match anywhere, or only at the beginning (required)
        :type searchanywhere: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_potential_users_serialize(
            courseid=courseid,
            enrolid=enrolid,
            page=page,
            perpage=perpage,
            search=search,
            searchanywhere=searchanywhere,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetPotentialUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_enrol_get_potential_users_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        enrolid: Annotated[Optional[StrictInt], Field(description="enrolment id")],
        page: Annotated[Optional[StrictInt], Field(description="Page number")],
        perpage: Annotated[Optional[StrictInt], Field(description="Number per page")],
        search: Annotated[Optional[StrictStr], Field(description="query")],
        searchanywhere: Annotated[Optional[StrictBool], Field(description="find a match anywhere, or only at the beginning")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the list of potential users to enrol

        Get the list of potential users to enrol

        :param courseid: course id (required)
        :type courseid: int
        :param enrolid: enrolment id (required)
        :type enrolid: int
        :param page: Page number (required)
        :type page: int
        :param perpage: Number per page (required)
        :type perpage: int
        :param search: query (required)
        :type search: str
        :param searchanywhere: find a match anywhere, or only at the beginning (required)
        :type searchanywhere: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_potential_users_serialize(
            courseid=courseid,
            enrolid=enrolid,
            page=page,
            perpage=perpage,
            search=search,
            searchanywhere=searchanywhere,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetPotentialUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_enrol_get_potential_users_serialize(
        self,
        courseid,
        enrolid,
        page,
        perpage,
        search,
        searchanywhere,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_enrol_get_potential_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_enrol_get_potential_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_enrol_get_potential_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if enrolid is not None:
            _form_params += parse_form({'enrolid': enrolid})
        if page is not None:
            _form_params += parse_form({'page': page})
        if perpage is not None:
            _form_params += parse_form({'perpage': perpage})
        if search is not None:
            _form_params += parse_form({'search': search})
        if searchanywhere is not None:
            _form_params += parse_form({'searchanywhere': searchanywhere})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_enrol_get_users_courses_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="user id")],
        returnusercount: Annotated[Optional[StrictBool], Field(description="Include count of enrolled users for each course? This can add several seconds to the response time if a user is on several large courses, so set this to false if the value will not be used to improve performance.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the list of courses where a user is enrolled in

        Get the list of courses where a user is enrolled in

        :param userid: user id (required)
        :type userid: int
        :param returnusercount: Include count of enrolled users for each course? This can add several seconds to the response time if a user is on several large courses, so set this to false if the value will not be used to improve performance.
        :type returnusercount: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_users_courses_serialize(
            userid=userid,
            returnusercount=returnusercount,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetUsersCoursesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_enrol_get_users_courses(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="user id")],
        returnusercount: Annotated[Optional[StrictBool], Field(description="Include count of enrolled users for each course? This can add several seconds to the response time if a user is on several large courses, so set this to false if the value will not be used to improve performance.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreEnrolGetUsersCoursesResponseInner]:
        """Get the list of courses where a user is enrolled in

        Get the list of courses where a user is enrolled in

        :param userid: user id (required)
        :type userid: int
        :param returnusercount: Include count of enrolled users for each course? This can add several seconds to the response time if a user is on several large courses, so set this to false if the value will not be used to improve performance.
        :type returnusercount: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_users_courses_serialize(
            userid=userid,
            returnusercount=returnusercount,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetUsersCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_enrol_get_users_courses_from_args(
        self,
        args
    ) -> List[CoreEnrolGetUsersCoursesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetUsersCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_enrol_get_users_courses_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="user id")],
        returnusercount: Annotated[Optional[StrictBool], Field(description="Include count of enrolled users for each course? This can add several seconds to the response time if a user is on several large courses, so set this to false if the value will not be used to improve performance.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreEnrolGetUsersCoursesResponseInner]]:
        """Get the list of courses where a user is enrolled in

        Get the list of courses where a user is enrolled in

        :param userid: user id (required)
        :type userid: int
        :param returnusercount: Include count of enrolled users for each course? This can add several seconds to the response time if a user is on several large courses, so set this to false if the value will not be used to improve performance.
        :type returnusercount: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_users_courses_serialize(
            userid=userid,
            returnusercount=returnusercount,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetUsersCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_enrol_get_users_courses_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="user id")],
        returnusercount: Annotated[Optional[StrictBool], Field(description="Include count of enrolled users for each course? This can add several seconds to the response time if a user is on several large courses, so set this to false if the value will not be used to improve performance.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the list of courses where a user is enrolled in

        Get the list of courses where a user is enrolled in

        :param userid: user id (required)
        :type userid: int
        :param returnusercount: Include count of enrolled users for each course? This can add several seconds to the response time if a user is on several large courses, so set this to false if the value will not be used to improve performance.
        :type returnusercount: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_get_users_courses_serialize(
            userid=userid,
            returnusercount=returnusercount,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetUsersCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_enrol_get_users_courses_serialize(
        self,
        userid,
        returnusercount,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_enrol_get_users_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_enrol_get_users_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_enrol_get_users_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if returnusercount is not None:
            _form_params += parse_form({'returnusercount': returnusercount})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_enrol_search_users_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        page: Annotated[Optional[StrictInt], Field(description="Page number")],
        perpage: Annotated[Optional[StrictInt], Field(description="Number per page")],
        search: Annotated[Optional[StrictStr], Field(description="query")],
        searchanywhere: Annotated[Optional[StrictBool], Field(description="find a match anywhere, or only at the beginning")],
        contextid: Annotated[Optional[StrictInt], Field(description="Context ID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Search within the list of course participants

        Search within the list of course participants

        :param courseid: course id (required)
        :type courseid: int
        :param page: Page number (required)
        :type page: int
        :param perpage: Number per page (required)
        :type perpage: int
        :param search: query (required)
        :type search: str
        :param searchanywhere: find a match anywhere, or only at the beginning (required)
        :type searchanywhere: bool
        :param contextid: Context ID
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_search_users_serialize(
            courseid=courseid,
            page=page,
            perpage=perpage,
            search=search,
            searchanywhere=searchanywhere,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetPotentialUsersResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_enrol_search_users(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        page: Annotated[Optional[StrictInt], Field(description="Page number")],
        perpage: Annotated[Optional[StrictInt], Field(description="Number per page")],
        search: Annotated[Optional[StrictStr], Field(description="query")],
        searchanywhere: Annotated[Optional[StrictBool], Field(description="find a match anywhere, or only at the beginning")],
        contextid: Annotated[Optional[StrictInt], Field(description="Context ID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreEnrolGetPotentialUsersResponseInner]:
        """Search within the list of course participants

        Search within the list of course participants

        :param courseid: course id (required)
        :type courseid: int
        :param page: Page number (required)
        :type page: int
        :param perpage: Number per page (required)
        :type perpage: int
        :param search: query (required)
        :type search: str
        :param searchanywhere: find a match anywhere, or only at the beginning (required)
        :type searchanywhere: bool
        :param contextid: Context ID
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_search_users_serialize(
            courseid=courseid,
            page=page,
            perpage=perpage,
            search=search,
            searchanywhere=searchanywhere,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetPotentialUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_enrol_search_users_from_args(
        self,
        args
    ) -> List[CoreEnrolGetPotentialUsersResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetPotentialUsersResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_enrol_search_users_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        page: Annotated[Optional[StrictInt], Field(description="Page number")],
        perpage: Annotated[Optional[StrictInt], Field(description="Number per page")],
        search: Annotated[Optional[StrictStr], Field(description="query")],
        searchanywhere: Annotated[Optional[StrictBool], Field(description="find a match anywhere, or only at the beginning")],
        contextid: Annotated[Optional[StrictInt], Field(description="Context ID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreEnrolGetPotentialUsersResponseInner]]:
        """Search within the list of course participants

        Search within the list of course participants

        :param courseid: course id (required)
        :type courseid: int
        :param page: Page number (required)
        :type page: int
        :param perpage: Number per page (required)
        :type perpage: int
        :param search: query (required)
        :type search: str
        :param searchanywhere: find a match anywhere, or only at the beginning (required)
        :type searchanywhere: bool
        :param contextid: Context ID
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_search_users_serialize(
            courseid=courseid,
            page=page,
            perpage=perpage,
            search=search,
            searchanywhere=searchanywhere,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetPotentialUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_enrol_search_users_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id")],
        page: Annotated[Optional[StrictInt], Field(description="Page number")],
        perpage: Annotated[Optional[StrictInt], Field(description="Number per page")],
        search: Annotated[Optional[StrictStr], Field(description="query")],
        searchanywhere: Annotated[Optional[StrictBool], Field(description="find a match anywhere, or only at the beginning")],
        contextid: Annotated[Optional[StrictInt], Field(description="Context ID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Search within the list of course participants

        Search within the list of course participants

        :param courseid: course id (required)
        :type courseid: int
        :param page: Page number (required)
        :type page: int
        :param perpage: Number per page (required)
        :type perpage: int
        :param search: query (required)
        :type search: str
        :param searchanywhere: find a match anywhere, or only at the beginning (required)
        :type searchanywhere: bool
        :param contextid: Context ID
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_search_users_serialize(
            courseid=courseid,
            page=page,
            perpage=perpage,
            search=search,
            searchanywhere=searchanywhere,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetPotentialUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_enrol_search_users_serialize(
        self,
        courseid,
        page,
        perpage,
        search,
        searchanywhere,
        contextid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_enrol_search_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_enrol_search_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_enrol_search_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if page is not None:
            _form_params += parse_form({'page': page})
        if perpage is not None:
            _form_params += parse_form({'perpage': perpage})
        if search is not None:
            _form_params += parse_form({'search': search})
        if searchanywhere is not None:
            _form_params += parse_form({'searchanywhere': searchanywhere})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_enrol_submit_user_enrolment_form_args(
        self,
        formdata: Annotated[Optional[StrictStr], Field(description="The data from the event form")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Submit form data for enrolment form

        Submit form data for enrolment form

        :param formdata: The data from the event form (required)
        :type formdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_submit_user_enrolment_form_serialize(
            formdata=formdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreEnrolSubmitUserEnrolmentFormResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_enrol_submit_user_enrolment_form(
        self,
        formdata: Annotated[Optional[StrictStr], Field(description="The data from the event form")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreEnrolSubmitUserEnrolmentFormResponse:
        """Submit form data for enrolment form

        Submit form data for enrolment form

        :param formdata: The data from the event form (required)
        :type formdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_submit_user_enrolment_form_serialize(
            formdata=formdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreEnrolSubmitUserEnrolmentFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_enrol_submit_user_enrolment_form_from_args(
        self,
        args
    ) -> CoreEnrolSubmitUserEnrolmentFormResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreEnrolSubmitUserEnrolmentFormResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_enrol_submit_user_enrolment_form_with_http_info(
        self,
        formdata: Annotated[Optional[StrictStr], Field(description="The data from the event form")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreEnrolSubmitUserEnrolmentFormResponse]:
        """Submit form data for enrolment form

        Submit form data for enrolment form

        :param formdata: The data from the event form (required)
        :type formdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_submit_user_enrolment_form_serialize(
            formdata=formdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreEnrolSubmitUserEnrolmentFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_enrol_submit_user_enrolment_form_without_preload_content(
        self,
        formdata: Annotated[Optional[StrictStr], Field(description="The data from the event form")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Submit form data for enrolment form

        Submit form data for enrolment form

        :param formdata: The data from the event form (required)
        :type formdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_submit_user_enrolment_form_serialize(
            formdata=formdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreEnrolSubmitUserEnrolmentFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_enrol_submit_user_enrolment_form_serialize(
        self,
        formdata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_enrol_submit_user_enrolment_form'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_enrol_submit_user_enrolment_form'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_enrol_submit_user_enrolment_form',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if formdata is not None:
            _form_params += parse_form({'formdata': formdata})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_enrol_unenrol_user_enrolment_args(
        self,
        ueid: Annotated[Optional[StrictInt], Field(description="User enrolment ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """External function that unenrols a given user enrolment

        External function that unenrols a given user enrolment

        :param ueid: User enrolment ID (required)
        :type ueid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_unenrol_user_enrolment_serialize(
            ueid=ueid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreEnrolUnenrolUserEnrolmentResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_enrol_unenrol_user_enrolment(
        self,
        ueid: Annotated[Optional[StrictInt], Field(description="User enrolment ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreEnrolUnenrolUserEnrolmentResponse:
        """External function that unenrols a given user enrolment

        External function that unenrols a given user enrolment

        :param ueid: User enrolment ID (required)
        :type ueid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_unenrol_user_enrolment_serialize(
            ueid=ueid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreEnrolUnenrolUserEnrolmentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_enrol_unenrol_user_enrolment_from_args(
        self,
        args
    ) -> CoreEnrolUnenrolUserEnrolmentResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreEnrolUnenrolUserEnrolmentResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_enrol_unenrol_user_enrolment_with_http_info(
        self,
        ueid: Annotated[Optional[StrictInt], Field(description="User enrolment ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreEnrolUnenrolUserEnrolmentResponse]:
        """External function that unenrols a given user enrolment

        External function that unenrols a given user enrolment

        :param ueid: User enrolment ID (required)
        :type ueid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_unenrol_user_enrolment_serialize(
            ueid=ueid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreEnrolUnenrolUserEnrolmentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_enrol_unenrol_user_enrolment_without_preload_content(
        self,
        ueid: Annotated[Optional[StrictInt], Field(description="User enrolment ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """External function that unenrols a given user enrolment

        External function that unenrols a given user enrolment

        :param ueid: User enrolment ID (required)
        :type ueid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_enrol_unenrol_user_enrolment_serialize(
            ueid=ueid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreEnrolUnenrolUserEnrolmentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_enrol_unenrol_user_enrolment_serialize(
        self,
        ueid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_enrol_unenrol_user_enrolment'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_enrol_unenrol_user_enrolment'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_enrol_unenrol_user_enrolment',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if ueid is not None:
            _form_params += parse_form({'ueid': ueid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_fetch_notifications_args(
        self,
        args: CoreFetchNotificationsParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return a list of notifications for the current session

        Return a list of notifications for the current session

        :param args: (required)
        :type args: CoreFetchNotificationsParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_fetch_notifications_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreFetchNotificationsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_fetch_notifications(
        self,
        args: CoreFetchNotificationsParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreFetchNotificationsResponseInner]:
        """Return a list of notifications for the current session

        Return a list of notifications for the current session

        :param args: (required)
        :type args: CoreFetchNotificationsParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_fetch_notifications_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreFetchNotificationsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_fetch_notifications_from_args(
        self,
        args
    ) -> List[CoreFetchNotificationsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreFetchNotificationsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_fetch_notifications_with_http_info(
        self,
        args: CoreFetchNotificationsParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreFetchNotificationsResponseInner]]:
        """Return a list of notifications for the current session

        Return a list of notifications for the current session

        :param args: (required)
        :type args: CoreFetchNotificationsParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_fetch_notifications_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreFetchNotificationsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_fetch_notifications_without_preload_content(
        self,
        args: CoreFetchNotificationsParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return a list of notifications for the current session

        Return a list of notifications for the current session

        :param args: (required)
        :type args: CoreFetchNotificationsParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_fetch_notifications_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreFetchNotificationsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_fetch_notifications_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#core_fetch_notifications'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_fetch_notifications'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_fetch_notifications',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_files_delete_draft_files_args(
        self,
        draftitemid: Annotated[Optional[StrictInt], Field(description="Item id of the draft file area")],
        files: Annotated[List[CoreFilesDeleteDraftFilesParametersFilesInner], Field(description="Files or directories to be deleted.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete the indicated files (or directories) from a user draft file area.

        Delete the indicated files (or directories) from a user draft file area.

        :param draftitemid: Item id of the draft file area (required)
        :type draftitemid: int
        :param files: Files or directories to be deleted. (required)
        :type files: List[CoreFilesDeleteDraftFilesParametersFilesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_files_delete_draft_files_serialize(
            draftitemid=draftitemid,
            files=files,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesDeleteDraftFilesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_files_delete_draft_files(
        self,
        draftitemid: Annotated[Optional[StrictInt], Field(description="Item id of the draft file area")],
        files: Annotated[List[CoreFilesDeleteDraftFilesParametersFilesInner], Field(description="Files or directories to be deleted.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreFilesDeleteDraftFilesResponse:
        """Delete the indicated files (or directories) from a user draft file area.

        Delete the indicated files (or directories) from a user draft file area.

        :param draftitemid: Item id of the draft file area (required)
        :type draftitemid: int
        :param files: Files or directories to be deleted. (required)
        :type files: List[CoreFilesDeleteDraftFilesParametersFilesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_files_delete_draft_files_serialize(
            draftitemid=draftitemid,
            files=files,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesDeleteDraftFilesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_files_delete_draft_files_from_args(
        self,
        args
    ) -> CoreFilesDeleteDraftFilesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesDeleteDraftFilesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_files_delete_draft_files_with_http_info(
        self,
        draftitemid: Annotated[Optional[StrictInt], Field(description="Item id of the draft file area")],
        files: Annotated[List[CoreFilesDeleteDraftFilesParametersFilesInner], Field(description="Files or directories to be deleted.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreFilesDeleteDraftFilesResponse]:
        """Delete the indicated files (or directories) from a user draft file area.

        Delete the indicated files (or directories) from a user draft file area.

        :param draftitemid: Item id of the draft file area (required)
        :type draftitemid: int
        :param files: Files or directories to be deleted. (required)
        :type files: List[CoreFilesDeleteDraftFilesParametersFilesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_files_delete_draft_files_serialize(
            draftitemid=draftitemid,
            files=files,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesDeleteDraftFilesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_files_delete_draft_files_without_preload_content(
        self,
        draftitemid: Annotated[Optional[StrictInt], Field(description="Item id of the draft file area")],
        files: Annotated[List[CoreFilesDeleteDraftFilesParametersFilesInner], Field(description="Files or directories to be deleted.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete the indicated files (or directories) from a user draft file area.

        Delete the indicated files (or directories) from a user draft file area.

        :param draftitemid: Item id of the draft file area (required)
        :type draftitemid: int
        :param files: Files or directories to be deleted. (required)
        :type files: List[CoreFilesDeleteDraftFilesParametersFilesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_files_delete_draft_files_serialize(
            draftitemid=draftitemid,
            files=files,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesDeleteDraftFilesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_files_delete_draft_files_serialize(
        self,
        draftitemid,
        files,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'files': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_files_delete_draft_files'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_files_delete_draft_files'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_files_delete_draft_files',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if draftitemid is not None:
            _form_params += parse_form({'draftitemid': draftitemid})
        if files is not None:
            _form_params += parse_form({'files': files})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_files_get_files_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        contextid: Annotated[Optional[StrictInt], Field(description="context id Set to -1 to use contextlevel and instanceid.")],
        filearea: Annotated[Optional[StrictStr], Field(description="file area")],
        filename: Annotated[Optional[StrictStr], Field(description="file name")],
        filepath: Annotated[Optional[StrictStr], Field(description="file path")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        contextlevel: Annotated[Optional[StrictStr], Field(description="The context level for the file location.")] = None,
        instanceid: Annotated[Optional[StrictInt], Field(description="The instance id for where the file is located.")] = None,
        modified: Annotated[Optional[StrictInt], Field(description="timestamp to return files changed after this time.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """browse moodle files

        browse moodle files

        :param component: component (required)
        :type component: str
        :param contextid: context id Set to -1 to use contextlevel and instanceid. (required)
        :type contextid: int
        :param filearea: file area (required)
        :type filearea: str
        :param filename: file name (required)
        :type filename: str
        :param filepath: file path (required)
        :type filepath: str
        :param itemid: associated id (required)
        :type itemid: int
        :param contextlevel: The context level for the file location.
        :type contextlevel: str
        :param instanceid: The instance id for where the file is located.
        :type instanceid: int
        :param modified: timestamp to return files changed after this time.
        :type modified: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_files_get_files_serialize(
            component=component,
            contextid=contextid,
            filearea=filearea,
            filename=filename,
            filepath=filepath,
            itemid=itemid,
            contextlevel=contextlevel,
            instanceid=instanceid,
            modified=modified,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesGetFilesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_files_get_files(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        contextid: Annotated[Optional[StrictInt], Field(description="context id Set to -1 to use contextlevel and instanceid.")],
        filearea: Annotated[Optional[StrictStr], Field(description="file area")],
        filename: Annotated[Optional[StrictStr], Field(description="file name")],
        filepath: Annotated[Optional[StrictStr], Field(description="file path")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        contextlevel: Annotated[Optional[StrictStr], Field(description="The context level for the file location.")] = None,
        instanceid: Annotated[Optional[StrictInt], Field(description="The instance id for where the file is located.")] = None,
        modified: Annotated[Optional[StrictInt], Field(description="timestamp to return files changed after this time.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreFilesGetFilesResponse:
        """browse moodle files

        browse moodle files

        :param component: component (required)
        :type component: str
        :param contextid: context id Set to -1 to use contextlevel and instanceid. (required)
        :type contextid: int
        :param filearea: file area (required)
        :type filearea: str
        :param filename: file name (required)
        :type filename: str
        :param filepath: file path (required)
        :type filepath: str
        :param itemid: associated id (required)
        :type itemid: int
        :param contextlevel: The context level for the file location.
        :type contextlevel: str
        :param instanceid: The instance id for where the file is located.
        :type instanceid: int
        :param modified: timestamp to return files changed after this time.
        :type modified: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_files_get_files_serialize(
            component=component,
            contextid=contextid,
            filearea=filearea,
            filename=filename,
            filepath=filepath,
            itemid=itemid,
            contextlevel=contextlevel,
            instanceid=instanceid,
            modified=modified,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesGetFilesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_files_get_files_from_args(
        self,
        args
    ) -> CoreFilesGetFilesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesGetFilesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_files_get_files_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        contextid: Annotated[Optional[StrictInt], Field(description="context id Set to -1 to use contextlevel and instanceid.")],
        filearea: Annotated[Optional[StrictStr], Field(description="file area")],
        filename: Annotated[Optional[StrictStr], Field(description="file name")],
        filepath: Annotated[Optional[StrictStr], Field(description="file path")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        contextlevel: Annotated[Optional[StrictStr], Field(description="The context level for the file location.")] = None,
        instanceid: Annotated[Optional[StrictInt], Field(description="The instance id for where the file is located.")] = None,
        modified: Annotated[Optional[StrictInt], Field(description="timestamp to return files changed after this time.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreFilesGetFilesResponse]:
        """browse moodle files

        browse moodle files

        :param component: component (required)
        :type component: str
        :param contextid: context id Set to -1 to use contextlevel and instanceid. (required)
        :type contextid: int
        :param filearea: file area (required)
        :type filearea: str
        :param filename: file name (required)
        :type filename: str
        :param filepath: file path (required)
        :type filepath: str
        :param itemid: associated id (required)
        :type itemid: int
        :param contextlevel: The context level for the file location.
        :type contextlevel: str
        :param instanceid: The instance id for where the file is located.
        :type instanceid: int
        :param modified: timestamp to return files changed after this time.
        :type modified: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_files_get_files_serialize(
            component=component,
            contextid=contextid,
            filearea=filearea,
            filename=filename,
            filepath=filepath,
            itemid=itemid,
            contextlevel=contextlevel,
            instanceid=instanceid,
            modified=modified,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesGetFilesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_files_get_files_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        contextid: Annotated[Optional[StrictInt], Field(description="context id Set to -1 to use contextlevel and instanceid.")],
        filearea: Annotated[Optional[StrictStr], Field(description="file area")],
        filename: Annotated[Optional[StrictStr], Field(description="file name")],
        filepath: Annotated[Optional[StrictStr], Field(description="file path")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        contextlevel: Annotated[Optional[StrictStr], Field(description="The context level for the file location.")] = None,
        instanceid: Annotated[Optional[StrictInt], Field(description="The instance id for where the file is located.")] = None,
        modified: Annotated[Optional[StrictInt], Field(description="timestamp to return files changed after this time.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """browse moodle files

        browse moodle files

        :param component: component (required)
        :type component: str
        :param contextid: context id Set to -1 to use contextlevel and instanceid. (required)
        :type contextid: int
        :param filearea: file area (required)
        :type filearea: str
        :param filename: file name (required)
        :type filename: str
        :param filepath: file path (required)
        :type filepath: str
        :param itemid: associated id (required)
        :type itemid: int
        :param contextlevel: The context level for the file location.
        :type contextlevel: str
        :param instanceid: The instance id for where the file is located.
        :type instanceid: int
        :param modified: timestamp to return files changed after this time.
        :type modified: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_files_get_files_serialize(
            component=component,
            contextid=contextid,
            filearea=filearea,
            filename=filename,
            filepath=filepath,
            itemid=itemid,
            contextlevel=contextlevel,
            instanceid=instanceid,
            modified=modified,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesGetFilesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_files_get_files_serialize(
        self,
        component,
        contextid,
        filearea,
        filename,
        filepath,
        itemid,
        contextlevel,
        instanceid,
        modified,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_files_get_files'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_files_get_files'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_files_get_files',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if component is not None:
            _form_params += parse_form({'component': component})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if contextlevel is not None:
            _form_params += parse_form({'contextlevel': contextlevel})
        if filearea is not None:
            _form_params += parse_form({'filearea': filearea})
        if filename is not None:
            _form_params += parse_form({'filename': filename})
        if filepath is not None:
            _form_params += parse_form({'filepath': filepath})
        if instanceid is not None:
            _form_params += parse_form({'instanceid': instanceid})
        if itemid is not None:
            _form_params += parse_form({'itemid': itemid})
        if modified is not None:
            _form_params += parse_form({'modified': modified})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_files_get_unused_draft_itemid_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Generate a new draft itemid for the current user.

        Generate a new draft itemid for the current user.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_files_get_unused_draft_itemid_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesGetUnusedDraftItemidResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_files_get_unused_draft_itemid(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreFilesGetUnusedDraftItemidResponse:
        """Generate a new draft itemid for the current user.

        Generate a new draft itemid for the current user.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_files_get_unused_draft_itemid_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesGetUnusedDraftItemidResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_files_get_unused_draft_itemid_from_args(
        self,
        args
    ) -> CoreFilesGetUnusedDraftItemidResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesGetUnusedDraftItemidResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_files_get_unused_draft_itemid_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreFilesGetUnusedDraftItemidResponse]:
        """Generate a new draft itemid for the current user.

        Generate a new draft itemid for the current user.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_files_get_unused_draft_itemid_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesGetUnusedDraftItemidResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_files_get_unused_draft_itemid_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Generate a new draft itemid for the current user.

        Generate a new draft itemid for the current user.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_files_get_unused_draft_itemid_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesGetUnusedDraftItemidResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_files_get_unused_draft_itemid_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_files_get_unused_draft_itemid'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_files_get_unused_draft_itemid'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_files_get_unused_draft_itemid',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_files_upload_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        filearea: Annotated[Optional[StrictStr], Field(description="file area")],
        filecontent: Annotated[Optional[StrictStr], Field(description="file content")],
        filename: Annotated[Optional[StrictStr], Field(description="file name")],
        filepath: Annotated[Optional[StrictStr], Field(description="file path")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        contextid: Annotated[Optional[StrictInt], Field(description="context id")] = None,
        contextlevel: Annotated[Optional[StrictStr], Field(description="The context level to put the file in,                         (block, course, coursecat, system, user, module)")] = None,
        instanceid: Annotated[Optional[StrictInt], Field(description="The Instance id of item associated                          with the context level")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """upload a file to moodle

        upload a file to moodle

        :param component: component (required)
        :type component: str
        :param filearea: file area (required)
        :type filearea: str
        :param filecontent: file content (required)
        :type filecontent: str
        :param filename: file name (required)
        :type filename: str
        :param filepath: file path (required)
        :type filepath: str
        :param itemid: associated id (required)
        :type itemid: int
        :param contextid: context id
        :type contextid: int
        :param contextlevel: The context level to put the file in,                         (block, course, coursecat, system, user, module)
        :type contextlevel: str
        :param instanceid: The Instance id of item associated                          with the context level
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_files_upload_serialize(
            component=component,
            filearea=filearea,
            filecontent=filecontent,
            filename=filename,
            filepath=filepath,
            itemid=itemid,
            contextid=contextid,
            contextlevel=contextlevel,
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesUploadResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_files_upload(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        filearea: Annotated[Optional[StrictStr], Field(description="file area")],
        filecontent: Annotated[Optional[StrictStr], Field(description="file content")],
        filename: Annotated[Optional[StrictStr], Field(description="file name")],
        filepath: Annotated[Optional[StrictStr], Field(description="file path")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        contextid: Annotated[Optional[StrictInt], Field(description="context id")] = None,
        contextlevel: Annotated[Optional[StrictStr], Field(description="The context level to put the file in,                         (block, course, coursecat, system, user, module)")] = None,
        instanceid: Annotated[Optional[StrictInt], Field(description="The Instance id of item associated                          with the context level")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreFilesUploadResponse:
        """upload a file to moodle

        upload a file to moodle

        :param component: component (required)
        :type component: str
        :param filearea: file area (required)
        :type filearea: str
        :param filecontent: file content (required)
        :type filecontent: str
        :param filename: file name (required)
        :type filename: str
        :param filepath: file path (required)
        :type filepath: str
        :param itemid: associated id (required)
        :type itemid: int
        :param contextid: context id
        :type contextid: int
        :param contextlevel: The context level to put the file in,                         (block, course, coursecat, system, user, module)
        :type contextlevel: str
        :param instanceid: The Instance id of item associated                          with the context level
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_files_upload_serialize(
            component=component,
            filearea=filearea,
            filecontent=filecontent,
            filename=filename,
            filepath=filepath,
            itemid=itemid,
            contextid=contextid,
            contextlevel=contextlevel,
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesUploadResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_files_upload_from_args(
        self,
        args
    ) -> CoreFilesUploadResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesUploadResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_files_upload_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        filearea: Annotated[Optional[StrictStr], Field(description="file area")],
        filecontent: Annotated[Optional[StrictStr], Field(description="file content")],
        filename: Annotated[Optional[StrictStr], Field(description="file name")],
        filepath: Annotated[Optional[StrictStr], Field(description="file path")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        contextid: Annotated[Optional[StrictInt], Field(description="context id")] = None,
        contextlevel: Annotated[Optional[StrictStr], Field(description="The context level to put the file in,                         (block, course, coursecat, system, user, module)")] = None,
        instanceid: Annotated[Optional[StrictInt], Field(description="The Instance id of item associated                          with the context level")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreFilesUploadResponse]:
        """upload a file to moodle

        upload a file to moodle

        :param component: component (required)
        :type component: str
        :param filearea: file area (required)
        :type filearea: str
        :param filecontent: file content (required)
        :type filecontent: str
        :param filename: file name (required)
        :type filename: str
        :param filepath: file path (required)
        :type filepath: str
        :param itemid: associated id (required)
        :type itemid: int
        :param contextid: context id
        :type contextid: int
        :param contextlevel: The context level to put the file in,                         (block, course, coursecat, system, user, module)
        :type contextlevel: str
        :param instanceid: The Instance id of item associated                          with the context level
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_files_upload_serialize(
            component=component,
            filearea=filearea,
            filecontent=filecontent,
            filename=filename,
            filepath=filepath,
            itemid=itemid,
            contextid=contextid,
            contextlevel=contextlevel,
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesUploadResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_files_upload_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        filearea: Annotated[Optional[StrictStr], Field(description="file area")],
        filecontent: Annotated[Optional[StrictStr], Field(description="file content")],
        filename: Annotated[Optional[StrictStr], Field(description="file name")],
        filepath: Annotated[Optional[StrictStr], Field(description="file path")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        contextid: Annotated[Optional[StrictInt], Field(description="context id")] = None,
        contextlevel: Annotated[Optional[StrictStr], Field(description="The context level to put the file in,                         (block, course, coursecat, system, user, module)")] = None,
        instanceid: Annotated[Optional[StrictInt], Field(description="The Instance id of item associated                          with the context level")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """upload a file to moodle

        upload a file to moodle

        :param component: component (required)
        :type component: str
        :param filearea: file area (required)
        :type filearea: str
        :param filecontent: file content (required)
        :type filecontent: str
        :param filename: file name (required)
        :type filename: str
        :param filepath: file path (required)
        :type filepath: str
        :param itemid: associated id (required)
        :type itemid: int
        :param contextid: context id
        :type contextid: int
        :param contextlevel: The context level to put the file in,                         (block, course, coursecat, system, user, module)
        :type contextlevel: str
        :param instanceid: The Instance id of item associated                          with the context level
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_files_upload_serialize(
            component=component,
            filearea=filearea,
            filecontent=filecontent,
            filename=filename,
            filepath=filepath,
            itemid=itemid,
            contextid=contextid,
            contextlevel=contextlevel,
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFilesUploadResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_files_upload_serialize(
        self,
        component,
        filearea,
        filecontent,
        filename,
        filepath,
        itemid,
        contextid,
        contextlevel,
        instanceid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_files_upload'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_files_upload'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_files_upload',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if component is not None:
            _form_params += parse_form({'component': component})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if contextlevel is not None:
            _form_params += parse_form({'contextlevel': contextlevel})
        if filearea is not None:
            _form_params += parse_form({'filearea': filearea})
        if filecontent is not None:
            _form_params += parse_form({'filecontent': filecontent})
        if filename is not None:
            _form_params += parse_form({'filename': filename})
        if filepath is not None:
            _form_params += parse_form({'filepath': filepath})
        if instanceid is not None:
            _form_params += parse_form({'instanceid': instanceid})
        if itemid is not None:
            _form_params += parse_form({'itemid': itemid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_filters_get_all_states_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve all the filters and their states (including overridden ones in any context).

        Retrieve all the filters and their states (including overridden ones in any context).

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_filters_get_all_states_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFiltersGetAllStatesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_filters_get_all_states(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreFiltersGetAllStatesResponse:
        """Retrieve all the filters and their states (including overridden ones in any context).

        Retrieve all the filters and their states (including overridden ones in any context).

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_filters_get_all_states_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFiltersGetAllStatesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_filters_get_all_states_from_args(
        self,
        args
    ) -> CoreFiltersGetAllStatesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFiltersGetAllStatesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_filters_get_all_states_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreFiltersGetAllStatesResponse]:
        """Retrieve all the filters and their states (including overridden ones in any context).

        Retrieve all the filters and their states (including overridden ones in any context).

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_filters_get_all_states_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFiltersGetAllStatesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_filters_get_all_states_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve all the filters and their states (including overridden ones in any context).

        Retrieve all the filters and their states (including overridden ones in any context).

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_filters_get_all_states_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFiltersGetAllStatesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_filters_get_all_states_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_filters_get_all_states'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_filters_get_all_states'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_filters_get_all_states',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_filters_get_available_in_context_args(
        self,
        contexts: Annotated[List[CoreFiltersGetAvailableInContextParametersContextsInner], Field(description="The list of contexts to check.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the filters available in the given contexts.

        Returns the filters available in the given contexts.

        :param contexts: The list of contexts to check. (required)
        :type contexts: List[CoreFiltersGetAvailableInContextParametersContextsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_filters_get_available_in_context_serialize(
            contexts=contexts,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFiltersGetAvailableInContextResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_filters_get_available_in_context(
        self,
        contexts: Annotated[List[CoreFiltersGetAvailableInContextParametersContextsInner], Field(description="The list of contexts to check.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreFiltersGetAvailableInContextResponse:
        """Returns the filters available in the given contexts.

        Returns the filters available in the given contexts.

        :param contexts: The list of contexts to check. (required)
        :type contexts: List[CoreFiltersGetAvailableInContextParametersContextsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_filters_get_available_in_context_serialize(
            contexts=contexts,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFiltersGetAvailableInContextResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_filters_get_available_in_context_from_args(
        self,
        args
    ) -> CoreFiltersGetAvailableInContextResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFiltersGetAvailableInContextResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_filters_get_available_in_context_with_http_info(
        self,
        contexts: Annotated[List[CoreFiltersGetAvailableInContextParametersContextsInner], Field(description="The list of contexts to check.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreFiltersGetAvailableInContextResponse]:
        """Returns the filters available in the given contexts.

        Returns the filters available in the given contexts.

        :param contexts: The list of contexts to check. (required)
        :type contexts: List[CoreFiltersGetAvailableInContextParametersContextsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_filters_get_available_in_context_serialize(
            contexts=contexts,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFiltersGetAvailableInContextResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_filters_get_available_in_context_without_preload_content(
        self,
        contexts: Annotated[List[CoreFiltersGetAvailableInContextParametersContextsInner], Field(description="The list of contexts to check.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the filters available in the given contexts.

        Returns the filters available in the given contexts.

        :param contexts: The list of contexts to check. (required)
        :type contexts: List[CoreFiltersGetAvailableInContextParametersContextsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_filters_get_available_in_context_serialize(
            contexts=contexts,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFiltersGetAvailableInContextResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_filters_get_available_in_context_serialize(
        self,
        contexts,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'contexts': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_filters_get_available_in_context'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_filters_get_available_in_context'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_filters_get_available_in_context',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if contexts is not None:
            _form_params += parse_form({'contexts': contexts})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_form_dynamic_form_args(
        self,
        form: Annotated[Optional[StrictStr], Field(description="Form class")],
        formdata: Annotated[Optional[StrictStr], Field(description="url-encoded form data")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Process submission of a dynamic (modal) form

        Process submission of a dynamic (modal) form

        :param form: Form class (required)
        :type form: str
        :param formdata: url-encoded form data (required)
        :type formdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_form_dynamic_form_serialize(
            form=form,
            formdata=formdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFormDynamicFormResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_form_dynamic_form(
        self,
        form: Annotated[Optional[StrictStr], Field(description="Form class")],
        formdata: Annotated[Optional[StrictStr], Field(description="url-encoded form data")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreFormDynamicFormResponse:
        """Process submission of a dynamic (modal) form

        Process submission of a dynamic (modal) form

        :param form: Form class (required)
        :type form: str
        :param formdata: url-encoded form data (required)
        :type formdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_form_dynamic_form_serialize(
            form=form,
            formdata=formdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFormDynamicFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_form_dynamic_form_from_args(
        self,
        args
    ) -> CoreFormDynamicFormResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFormDynamicFormResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_form_dynamic_form_with_http_info(
        self,
        form: Annotated[Optional[StrictStr], Field(description="Form class")],
        formdata: Annotated[Optional[StrictStr], Field(description="url-encoded form data")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreFormDynamicFormResponse]:
        """Process submission of a dynamic (modal) form

        Process submission of a dynamic (modal) form

        :param form: Form class (required)
        :type form: str
        :param formdata: url-encoded form data (required)
        :type formdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_form_dynamic_form_serialize(
            form=form,
            formdata=formdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFormDynamicFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_form_dynamic_form_without_preload_content(
        self,
        form: Annotated[Optional[StrictStr], Field(description="Form class")],
        formdata: Annotated[Optional[StrictStr], Field(description="url-encoded form data")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Process submission of a dynamic (modal) form

        Process submission of a dynamic (modal) form

        :param form: Form class (required)
        :type form: str
        :param formdata: url-encoded form data (required)
        :type formdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_form_dynamic_form_serialize(
            form=form,
            formdata=formdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFormDynamicFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_form_dynamic_form_serialize(
        self,
        form,
        formdata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_form_dynamic_form'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_form_dynamic_form'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_form_dynamic_form',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if form is not None:
            _form_params += parse_form({'form': form})
        if formdata is not None:
            _form_params += parse_form({'formdata': formdata})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_form_get_filetypes_browser_data_args(
        self,
        args: CoreFormGetFiletypesBrowserDataParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Provides data for the filetypes element browser.

        Provides data for the filetypes element browser.

        :param args: (required)
        :type args: CoreFormGetFiletypesBrowserDataParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_form_get_filetypes_browser_data_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFormGetFiletypesBrowserDataResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_form_get_filetypes_browser_data(
        self,
        args: CoreFormGetFiletypesBrowserDataParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreFormGetFiletypesBrowserDataResponse:
        """Provides data for the filetypes element browser.

        Provides data for the filetypes element browser.

        :param args: (required)
        :type args: CoreFormGetFiletypesBrowserDataParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_form_get_filetypes_browser_data_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFormGetFiletypesBrowserDataResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_form_get_filetypes_browser_data_from_args(
        self,
        args
    ) -> CoreFormGetFiletypesBrowserDataResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFormGetFiletypesBrowserDataResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_form_get_filetypes_browser_data_with_http_info(
        self,
        args: CoreFormGetFiletypesBrowserDataParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreFormGetFiletypesBrowserDataResponse]:
        """Provides data for the filetypes element browser.

        Provides data for the filetypes element browser.

        :param args: (required)
        :type args: CoreFormGetFiletypesBrowserDataParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_form_get_filetypes_browser_data_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFormGetFiletypesBrowserDataResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_form_get_filetypes_browser_data_without_preload_content(
        self,
        args: CoreFormGetFiletypesBrowserDataParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Provides data for the filetypes element browser.

        Provides data for the filetypes element browser.

        :param args: (required)
        :type args: CoreFormGetFiletypesBrowserDataParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_form_get_filetypes_browser_data_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreFormGetFiletypesBrowserDataResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_form_get_filetypes_browser_data_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#core_form_get_filetypes_browser_data'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_form_get_filetypes_browser_data'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_form_get_filetypes_browser_data',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_get_component_strings_args(
        self,
        args: CoreGetComponentStringsParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return all raw strings (with {$a->xxx}), for a specific component - similar to core get_component_strings(), call

        Return all raw strings (with {$a->xxx}), for a specific component - similar to core get_component_strings(), call

        :param args: (required)
        :type args: CoreGetComponentStringsParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_component_strings_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGetComponentStringsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_get_component_strings(
        self,
        args: CoreGetComponentStringsParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreGetComponentStringsResponseInner]:
        """Return all raw strings (with {$a->xxx}), for a specific component - similar to core get_component_strings(), call

        Return all raw strings (with {$a->xxx}), for a specific component - similar to core get_component_strings(), call

        :param args: (required)
        :type args: CoreGetComponentStringsParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_component_strings_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGetComponentStringsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_get_component_strings_from_args(
        self,
        args
    ) -> List[CoreGetComponentStringsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGetComponentStringsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_get_component_strings_with_http_info(
        self,
        args: CoreGetComponentStringsParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreGetComponentStringsResponseInner]]:
        """Return all raw strings (with {$a->xxx}), for a specific component - similar to core get_component_strings(), call

        Return all raw strings (with {$a->xxx}), for a specific component - similar to core get_component_strings(), call

        :param args: (required)
        :type args: CoreGetComponentStringsParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_component_strings_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGetComponentStringsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_get_component_strings_without_preload_content(
        self,
        args: CoreGetComponentStringsParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return all raw strings (with {$a->xxx}), for a specific component - similar to core get_component_strings(), call

        Return all raw strings (with {$a->xxx}), for a specific component - similar to core get_component_strings(), call

        :param args: (required)
        :type args: CoreGetComponentStringsParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_component_strings_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGetComponentStringsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_get_component_strings_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#core_get_component_strings'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_get_component_strings'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_get_component_strings',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_get_fragment_args(
        self,
        param_callback: Annotated[Optional[StrictStr], Field(description="Name of the callback to execute")],
        component: Annotated[Optional[StrictStr], Field(description="Component for the callback e.g. mod_assign")],
        contextid: Annotated[Optional[StrictInt], Field(description="Context ID that the fragment is from")],
        args: Annotated[Optional[List[CoreGetFragmentParametersArgsInner]], Field(description="args for the callback are optional")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return a fragment for inclusion, such as a JavaScript page.

        Return a fragment for inclusion, such as a JavaScript page.

        :param param_callback: Name of the callback to execute (required)
        :type param_callback: str
        :param component: Component for the callback e.g. mod_assign (required)
        :type component: str
        :param contextid: Context ID that the fragment is from (required)
        :type contextid: int
        :param args: args for the callback are optional
        :type args: List[CoreGetFragmentParametersArgsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_fragment_serialize(
            param_callback=param_callback,
            component=component,
            contextid=contextid,
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGetFragmentResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_get_fragment(
        self,
        param_callback: Annotated[Optional[StrictStr], Field(description="Name of the callback to execute")],
        component: Annotated[Optional[StrictStr], Field(description="Component for the callback e.g. mod_assign")],
        contextid: Annotated[Optional[StrictInt], Field(description="Context ID that the fragment is from")],
        args: Annotated[Optional[List[CoreGetFragmentParametersArgsInner]], Field(description="args for the callback are optional")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGetFragmentResponse:
        """Return a fragment for inclusion, such as a JavaScript page.

        Return a fragment for inclusion, such as a JavaScript page.

        :param param_callback: Name of the callback to execute (required)
        :type param_callback: str
        :param component: Component for the callback e.g. mod_assign (required)
        :type component: str
        :param contextid: Context ID that the fragment is from (required)
        :type contextid: int
        :param args: args for the callback are optional
        :type args: List[CoreGetFragmentParametersArgsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_fragment_serialize(
            param_callback=param_callback,
            component=component,
            contextid=contextid,
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGetFragmentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_get_fragment_from_args(
        self,
        args
    ) -> CoreGetFragmentResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGetFragmentResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_get_fragment_with_http_info(
        self,
        param_callback: Annotated[Optional[StrictStr], Field(description="Name of the callback to execute")],
        component: Annotated[Optional[StrictStr], Field(description="Component for the callback e.g. mod_assign")],
        contextid: Annotated[Optional[StrictInt], Field(description="Context ID that the fragment is from")],
        args: Annotated[Optional[List[CoreGetFragmentParametersArgsInner]], Field(description="args for the callback are optional")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGetFragmentResponse]:
        """Return a fragment for inclusion, such as a JavaScript page.

        Return a fragment for inclusion, such as a JavaScript page.

        :param param_callback: Name of the callback to execute (required)
        :type param_callback: str
        :param component: Component for the callback e.g. mod_assign (required)
        :type component: str
        :param contextid: Context ID that the fragment is from (required)
        :type contextid: int
        :param args: args for the callback are optional
        :type args: List[CoreGetFragmentParametersArgsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_fragment_serialize(
            param_callback=param_callback,
            component=component,
            contextid=contextid,
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGetFragmentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_get_fragment_without_preload_content(
        self,
        param_callback: Annotated[Optional[StrictStr], Field(description="Name of the callback to execute")],
        component: Annotated[Optional[StrictStr], Field(description="Component for the callback e.g. mod_assign")],
        contextid: Annotated[Optional[StrictInt], Field(description="Context ID that the fragment is from")],
        args: Annotated[Optional[List[CoreGetFragmentParametersArgsInner]], Field(description="args for the callback are optional")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return a fragment for inclusion, such as a JavaScript page.

        Return a fragment for inclusion, such as a JavaScript page.

        :param param_callback: Name of the callback to execute (required)
        :type param_callback: str
        :param component: Component for the callback e.g. mod_assign (required)
        :type component: str
        :param contextid: Context ID that the fragment is from (required)
        :type contextid: int
        :param args: args for the callback are optional
        :type args: List[CoreGetFragmentParametersArgsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_fragment_serialize(
            param_callback=param_callback,
            component=component,
            contextid=contextid,
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGetFragmentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_get_fragment_serialize(
        self,
        param_callback,
        component,
        contextid,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'args': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_get_fragment'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_get_fragment'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_get_fragment',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if args is not None:
            _form_params += parse_form({'args': args})
        if param_callback is not None:
            _form_params += parse_form({'callback': param_callback})
        if component is not None:
            _form_params += parse_form({'component': component})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_get_string_args(
        self,
        args: CoreGetStringParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return a translated string - similar to core get_string(), call

        Return a translated string - similar to core get_string(), call

        :param args: (required)
        :type args: CoreGetStringParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_string_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_get_string(
        self,
        args: CoreGetStringParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """Return a translated string - similar to core get_string(), call

        Return a translated string - similar to core get_string(), call

        :param args: (required)
        :type args: CoreGetStringParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_string_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_get_string_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_get_string_with_http_info(
        self,
        args: CoreGetStringParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """Return a translated string - similar to core get_string(), call

        Return a translated string - similar to core get_string(), call

        :param args: (required)
        :type args: CoreGetStringParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_string_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_get_string_without_preload_content(
        self,
        args: CoreGetStringParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return a translated string - similar to core get_string(), call

        Return a translated string - similar to core get_string(), call

        :param args: (required)
        :type args: CoreGetStringParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_string_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_get_string_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#core_get_string'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_get_string'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_get_string',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_get_strings_args(
        self,
        args: CoreGetStringsParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return some translated strings - like several core get_string(), calls

        Return some translated strings - like several core get_string(), calls

        :param args: (required)
        :type args: CoreGetStringsParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_strings_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGetStringsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_get_strings(
        self,
        args: CoreGetStringsParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreGetStringsResponseInner]:
        """Return some translated strings - like several core get_string(), calls

        Return some translated strings - like several core get_string(), calls

        :param args: (required)
        :type args: CoreGetStringsParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_strings_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGetStringsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_get_strings_from_args(
        self,
        args
    ) -> List[CoreGetStringsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGetStringsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_get_strings_with_http_info(
        self,
        args: CoreGetStringsParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreGetStringsResponseInner]]:
        """Return some translated strings - like several core get_string(), calls

        Return some translated strings - like several core get_string(), calls

        :param args: (required)
        :type args: CoreGetStringsParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_strings_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGetStringsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_get_strings_without_preload_content(
        self,
        args: CoreGetStringsParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return some translated strings - like several core get_string(), calls

        Return some translated strings - like several core get_string(), calls

        :param args: (required)
        :type args: CoreGetStringsParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_strings_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGetStringsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_get_strings_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#core_get_strings'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_get_strings'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_get_strings',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_get_user_dates_args(
        self,
        timestamps: List[CoreGetUserDatesParametersTimestampsInner],
        contextid: Annotated[Optional[StrictInt], Field(description="Context ID. Either use this value, or level and instanceid.")] = None,
        contextlevel: Annotated[Optional[StrictStr], Field(description="Context level. To be used with instanceid.")] = None,
        instanceid: Annotated[Optional[StrictInt], Field(description="Context instance ID. To be used with level")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return formatted timestamps

        Return formatted timestamps

        :param timestamps: (required)
        :type timestamps: List[CoreGetUserDatesParametersTimestampsInner]
        :param contextid: Context ID. Either use this value, or level and instanceid.
        :type contextid: int
        :param contextlevel: Context level. To be used with instanceid.
        :type contextlevel: str
        :param instanceid: Context instance ID. To be used with level
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_user_dates_serialize(
            timestamps=timestamps,
            contextid=contextid,
            contextlevel=contextlevel,
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGetUserDatesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_get_user_dates(
        self,
        timestamps: List[CoreGetUserDatesParametersTimestampsInner],
        contextid: Annotated[Optional[StrictInt], Field(description="Context ID. Either use this value, or level and instanceid.")] = None,
        contextlevel: Annotated[Optional[StrictStr], Field(description="Context level. To be used with instanceid.")] = None,
        instanceid: Annotated[Optional[StrictInt], Field(description="Context instance ID. To be used with level")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGetUserDatesResponse:
        """Return formatted timestamps

        Return formatted timestamps

        :param timestamps: (required)
        :type timestamps: List[CoreGetUserDatesParametersTimestampsInner]
        :param contextid: Context ID. Either use this value, or level and instanceid.
        :type contextid: int
        :param contextlevel: Context level. To be used with instanceid.
        :type contextlevel: str
        :param instanceid: Context instance ID. To be used with level
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_user_dates_serialize(
            timestamps=timestamps,
            contextid=contextid,
            contextlevel=contextlevel,
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGetUserDatesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_get_user_dates_from_args(
        self,
        args
    ) -> CoreGetUserDatesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGetUserDatesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_get_user_dates_with_http_info(
        self,
        timestamps: List[CoreGetUserDatesParametersTimestampsInner],
        contextid: Annotated[Optional[StrictInt], Field(description="Context ID. Either use this value, or level and instanceid.")] = None,
        contextlevel: Annotated[Optional[StrictStr], Field(description="Context level. To be used with instanceid.")] = None,
        instanceid: Annotated[Optional[StrictInt], Field(description="Context instance ID. To be used with level")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGetUserDatesResponse]:
        """Return formatted timestamps

        Return formatted timestamps

        :param timestamps: (required)
        :type timestamps: List[CoreGetUserDatesParametersTimestampsInner]
        :param contextid: Context ID. Either use this value, or level and instanceid.
        :type contextid: int
        :param contextlevel: Context level. To be used with instanceid.
        :type contextlevel: str
        :param instanceid: Context instance ID. To be used with level
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_user_dates_serialize(
            timestamps=timestamps,
            contextid=contextid,
            contextlevel=contextlevel,
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGetUserDatesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_get_user_dates_without_preload_content(
        self,
        timestamps: List[CoreGetUserDatesParametersTimestampsInner],
        contextid: Annotated[Optional[StrictInt], Field(description="Context ID. Either use this value, or level and instanceid.")] = None,
        contextlevel: Annotated[Optional[StrictStr], Field(description="Context level. To be used with instanceid.")] = None,
        instanceid: Annotated[Optional[StrictInt], Field(description="Context instance ID. To be used with level")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return formatted timestamps

        Return formatted timestamps

        :param timestamps: (required)
        :type timestamps: List[CoreGetUserDatesParametersTimestampsInner]
        :param contextid: Context ID. Either use this value, or level and instanceid.
        :type contextid: int
        :param contextlevel: Context level. To be used with instanceid.
        :type contextlevel: str
        :param instanceid: Context instance ID. To be used with level
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_get_user_dates_serialize(
            timestamps=timestamps,
            contextid=contextid,
            contextlevel=contextlevel,
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGetUserDatesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_get_user_dates_serialize(
        self,
        timestamps,
        contextid,
        contextlevel,
        instanceid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'timestamps': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_get_user_dates'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_get_user_dates'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_get_user_dates',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if contextlevel is not None:
            _form_params += parse_form({'contextlevel': contextlevel})
        if instanceid is not None:
            _form_params += parse_form({'instanceid': instanceid})
        if timestamps is not None:
            _form_params += parse_form({'timestamps': timestamps})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_grades_create_gradecategories_args(
        self,
        categories: Annotated[List[CoreGradesCreateGradecategoriesParametersCategoriesInner], Field(description="Categories to create")],
        courseid: Annotated[Optional[StrictInt], Field(description="id of course")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Create grade categories inside a course gradebook.

        Create grade categories inside a course gradebook.

        :param categories: Categories to create (required)
        :type categories: List[CoreGradesCreateGradecategoriesParametersCategoriesInner]
        :param courseid: id of course (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_create_gradecategories_serialize(
            categories=categories,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesCreateGradecategoriesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_grades_create_gradecategories(
        self,
        categories: Annotated[List[CoreGradesCreateGradecategoriesParametersCategoriesInner], Field(description="Categories to create")],
        courseid: Annotated[Optional[StrictInt], Field(description="id of course")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGradesCreateGradecategoriesResponse:
        """Create grade categories inside a course gradebook.

        Create grade categories inside a course gradebook.

        :param categories: Categories to create (required)
        :type categories: List[CoreGradesCreateGradecategoriesParametersCategoriesInner]
        :param courseid: id of course (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_create_gradecategories_serialize(
            categories=categories,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesCreateGradecategoriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_create_gradecategories_from_args(
        self,
        args
    ) -> CoreGradesCreateGradecategoriesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesCreateGradecategoriesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_create_gradecategories_with_http_info(
        self,
        categories: Annotated[List[CoreGradesCreateGradecategoriesParametersCategoriesInner], Field(description="Categories to create")],
        courseid: Annotated[Optional[StrictInt], Field(description="id of course")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGradesCreateGradecategoriesResponse]:
        """Create grade categories inside a course gradebook.

        Create grade categories inside a course gradebook.

        :param categories: Categories to create (required)
        :type categories: List[CoreGradesCreateGradecategoriesParametersCategoriesInner]
        :param courseid: id of course (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_create_gradecategories_serialize(
            categories=categories,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesCreateGradecategoriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_grades_create_gradecategories_without_preload_content(
        self,
        categories: Annotated[List[CoreGradesCreateGradecategoriesParametersCategoriesInner], Field(description="Categories to create")],
        courseid: Annotated[Optional[StrictInt], Field(description="id of course")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create grade categories inside a course gradebook.

        Create grade categories inside a course gradebook.

        :param categories: Categories to create (required)
        :type categories: List[CoreGradesCreateGradecategoriesParametersCategoriesInner]
        :param courseid: id of course (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_create_gradecategories_serialize(
            categories=categories,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesCreateGradecategoriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_grades_create_gradecategories_serialize(
        self,
        categories,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'categories': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_grades_create_gradecategories'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_grades_create_gradecategories'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_grades_create_gradecategories',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if categories is not None:
            _form_params += parse_form({'categories': categories})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_grades_get_enrolled_users_for_selector_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group Id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the enrolled users within and map some fields to the returned array of user objects.

        Returns the enrolled users within and map some fields to the returned array of user objects.

        :param courseid: Course Id (required)
        :type courseid: int
        :param groupid: Group Id
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_enrolled_users_for_selector_serialize(
            courseid=courseid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetEnrolledUsersForSelectorResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_grades_get_enrolled_users_for_selector(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group Id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGradesGetEnrolledUsersForSelectorResponse:
        """Returns the enrolled users within and map some fields to the returned array of user objects.

        Returns the enrolled users within and map some fields to the returned array of user objects.

        :param courseid: Course Id (required)
        :type courseid: int
        :param groupid: Group Id
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_enrolled_users_for_selector_serialize(
            courseid=courseid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetEnrolledUsersForSelectorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_get_enrolled_users_for_selector_from_args(
        self,
        args
    ) -> CoreGradesGetEnrolledUsersForSelectorResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetEnrolledUsersForSelectorResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_get_enrolled_users_for_selector_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group Id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGradesGetEnrolledUsersForSelectorResponse]:
        """Returns the enrolled users within and map some fields to the returned array of user objects.

        Returns the enrolled users within and map some fields to the returned array of user objects.

        :param courseid: Course Id (required)
        :type courseid: int
        :param groupid: Group Id
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_enrolled_users_for_selector_serialize(
            courseid=courseid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetEnrolledUsersForSelectorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_grades_get_enrolled_users_for_selector_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group Id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the enrolled users within and map some fields to the returned array of user objects.

        Returns the enrolled users within and map some fields to the returned array of user objects.

        :param courseid: Course Id (required)
        :type courseid: int
        :param groupid: Group Id
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_enrolled_users_for_selector_serialize(
            courseid=courseid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetEnrolledUsersForSelectorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_grades_get_enrolled_users_for_selector_serialize(
        self,
        courseid,
        groupid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_grades_get_enrolled_users_for_selector'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_grades_get_enrolled_users_for_selector'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_grades_get_enrolled_users_for_selector',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_grades_get_feedback_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        itemid: Annotated[Optional[StrictInt], Field(description="Grade Item ID")],
        userid: Annotated[Optional[StrictInt], Field(description="User ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the feedback data for a grade item

        Get the feedback data for a grade item

        :param courseid: Course ID (required)
        :type courseid: int
        :param itemid: Grade Item ID (required)
        :type itemid: int
        :param userid: User ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_feedback_serialize(
            courseid=courseid,
            itemid=itemid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetFeedbackResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_grades_get_feedback(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        itemid: Annotated[Optional[StrictInt], Field(description="Grade Item ID")],
        userid: Annotated[Optional[StrictInt], Field(description="User ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGradesGetFeedbackResponse:
        """Get the feedback data for a grade item

        Get the feedback data for a grade item

        :param courseid: Course ID (required)
        :type courseid: int
        :param itemid: Grade Item ID (required)
        :type itemid: int
        :param userid: User ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_feedback_serialize(
            courseid=courseid,
            itemid=itemid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetFeedbackResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_get_feedback_from_args(
        self,
        args
    ) -> CoreGradesGetFeedbackResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetFeedbackResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_get_feedback_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        itemid: Annotated[Optional[StrictInt], Field(description="Grade Item ID")],
        userid: Annotated[Optional[StrictInt], Field(description="User ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGradesGetFeedbackResponse]:
        """Get the feedback data for a grade item

        Get the feedback data for a grade item

        :param courseid: Course ID (required)
        :type courseid: int
        :param itemid: Grade Item ID (required)
        :type itemid: int
        :param userid: User ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_feedback_serialize(
            courseid=courseid,
            itemid=itemid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetFeedbackResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_grades_get_feedback_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        itemid: Annotated[Optional[StrictInt], Field(description="Grade Item ID")],
        userid: Annotated[Optional[StrictInt], Field(description="User ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the feedback data for a grade item

        Get the feedback data for a grade item

        :param courseid: Course ID (required)
        :type courseid: int
        :param itemid: Grade Item ID (required)
        :type itemid: int
        :param userid: User ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_feedback_serialize(
            courseid=courseid,
            itemid=itemid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetFeedbackResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_grades_get_feedback_serialize(
        self,
        courseid,
        itemid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_grades_get_feedback'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_grades_get_feedback'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_grades_get_feedback',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if itemid is not None:
            _form_params += parse_form({'itemid': itemid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_grades_get_gradable_users_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group Id")] = None,
        onlyactive: Annotated[Optional[StrictBool], Field(description="Only active enrolment")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the gradable users in a course

        Returns the gradable users in a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param groupid: Group Id
        :type groupid: int
        :param onlyactive: Only active enrolment
        :type onlyactive: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_gradable_users_serialize(
            courseid=courseid,
            groupid=groupid,
            onlyactive=onlyactive,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetGradableUsersResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_grades_get_gradable_users(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group Id")] = None,
        onlyactive: Annotated[Optional[StrictBool], Field(description="Only active enrolment")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGradesGetGradableUsersResponse:
        """Returns the gradable users in a course

        Returns the gradable users in a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param groupid: Group Id
        :type groupid: int
        :param onlyactive: Only active enrolment
        :type onlyactive: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_gradable_users_serialize(
            courseid=courseid,
            groupid=groupid,
            onlyactive=onlyactive,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetGradableUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_get_gradable_users_from_args(
        self,
        args
    ) -> CoreGradesGetGradableUsersResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetGradableUsersResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_get_gradable_users_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group Id")] = None,
        onlyactive: Annotated[Optional[StrictBool], Field(description="Only active enrolment")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGradesGetGradableUsersResponse]:
        """Returns the gradable users in a course

        Returns the gradable users in a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param groupid: Group Id
        :type groupid: int
        :param onlyactive: Only active enrolment
        :type onlyactive: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_gradable_users_serialize(
            courseid=courseid,
            groupid=groupid,
            onlyactive=onlyactive,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetGradableUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_grades_get_gradable_users_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group Id")] = None,
        onlyactive: Annotated[Optional[StrictBool], Field(description="Only active enrolment")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the gradable users in a course

        Returns the gradable users in a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param groupid: Group Id
        :type groupid: int
        :param onlyactive: Only active enrolment
        :type onlyactive: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_gradable_users_serialize(
            courseid=courseid,
            groupid=groupid,
            onlyactive=onlyactive,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetGradableUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_grades_get_gradable_users_serialize(
        self,
        courseid,
        groupid,
        onlyactive,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_grades_get_gradable_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_grades_get_gradable_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_grades_get_gradable_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if onlyactive is not None:
            _form_params += parse_form({'onlyactive': onlyactive})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_grades_get_grade_tree_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the grade tree structure for a course

        Get the grade tree structure for a course

        :param courseid: Course ID (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_grade_tree_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_grades_get_grade_tree(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """Get the grade tree structure for a course

        Get the grade tree structure for a course

        :param courseid: Course ID (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_grade_tree_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_get_grade_tree_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_get_grade_tree_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """Get the grade tree structure for a course

        Get the grade tree structure for a course

        :param courseid: Course ID (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_grade_tree_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_grades_get_grade_tree_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the grade tree structure for a course

        Get the grade tree structure for a course

        :param courseid: Course ID (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_grade_tree_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_grades_get_grade_tree_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_grades_get_grade_tree'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_grades_get_grade_tree'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_grades_get_grade_tree',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_grades_get_gradeitems_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the gradeitems for a course

        Get the gradeitems for a course

        :param courseid: Course ID (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_gradeitems_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetGradeitemsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_grades_get_gradeitems(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGradesGetGradeitemsResponse:
        """Get the gradeitems for a course

        Get the gradeitems for a course

        :param courseid: Course ID (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_gradeitems_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetGradeitemsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_get_gradeitems_from_args(
        self,
        args
    ) -> CoreGradesGetGradeitemsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetGradeitemsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_get_gradeitems_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGradesGetGradeitemsResponse]:
        """Get the gradeitems for a course

        Get the gradeitems for a course

        :param courseid: Course ID (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_gradeitems_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetGradeitemsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_grades_get_gradeitems_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the gradeitems for a course

        Get the gradeitems for a course

        :param courseid: Course ID (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_gradeitems_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetGradeitemsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_grades_get_gradeitems_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_grades_get_gradeitems'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_grades_get_gradeitems'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_grades_get_gradeitems',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_grades_get_groups_for_selector_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        cmid: Annotated[Optional[StrictInt], Field(description="Course module Id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """** DEPRECATED ** Please do not call this function any more. Use core_group_get_groups_for_selector instead. Get the group/(s) for a course

        ** DEPRECATED ** Please do not call this function any more. Use core_group_get_groups_for_selector instead. Get the group/(s) for a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param cmid: Course module Id
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_groups_for_selector_serialize(
            courseid=courseid,
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetGroupsForSelectorResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_grades_get_groups_for_selector(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        cmid: Annotated[Optional[StrictInt], Field(description="Course module Id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGradesGetGroupsForSelectorResponse:
        """** DEPRECATED ** Please do not call this function any more. Use core_group_get_groups_for_selector instead. Get the group/(s) for a course

        ** DEPRECATED ** Please do not call this function any more. Use core_group_get_groups_for_selector instead. Get the group/(s) for a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param cmid: Course module Id
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_groups_for_selector_serialize(
            courseid=courseid,
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetGroupsForSelectorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_get_groups_for_selector_from_args(
        self,
        args
    ) -> CoreGradesGetGroupsForSelectorResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetGroupsForSelectorResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_get_groups_for_selector_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        cmid: Annotated[Optional[StrictInt], Field(description="Course module Id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGradesGetGroupsForSelectorResponse]:
        """** DEPRECATED ** Please do not call this function any more. Use core_group_get_groups_for_selector instead. Get the group/(s) for a course

        ** DEPRECATED ** Please do not call this function any more. Use core_group_get_groups_for_selector instead. Get the group/(s) for a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param cmid: Course module Id
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_groups_for_selector_serialize(
            courseid=courseid,
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetGroupsForSelectorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_grades_get_groups_for_selector_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        cmid: Annotated[Optional[StrictInt], Field(description="Course module Id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """** DEPRECATED ** Please do not call this function any more. Use core_group_get_groups_for_selector instead. Get the group/(s) for a course

        ** DEPRECATED ** Please do not call this function any more. Use core_group_get_groups_for_selector instead. Get the group/(s) for a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param cmid: Course module Id
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_get_groups_for_selector_serialize(
            courseid=courseid,
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGetGroupsForSelectorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_grades_get_groups_for_selector_serialize(
        self,
        courseid,
        cmid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_grades_get_groups_for_selector'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_grades_get_groups_for_selector'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_grades_get_groups_for_selector',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_grades_grader_gradingpanel_point_fetch_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetch the data required to display the grader grading panel for simple grading, creating the grade item if required

        Fetch the data required to display the grader grading panel for simple grading, creating the grade item if required

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_grader_gradingpanel_point_fetch_serialize(
            component=component,
            contextid=contextid,
            gradeduserid=gradeduserid,
            itemname=itemname,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelPointFetchResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_grades_grader_gradingpanel_point_fetch(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGradesGraderGradingpanelPointFetchResponse:
        """Fetch the data required to display the grader grading panel for simple grading, creating the grade item if required

        Fetch the data required to display the grader grading panel for simple grading, creating the grade item if required

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_grader_gradingpanel_point_fetch_serialize(
            component=component,
            contextid=contextid,
            gradeduserid=gradeduserid,
            itemname=itemname,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelPointFetchResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_grader_gradingpanel_point_fetch_from_args(
        self,
        args
    ) -> CoreGradesGraderGradingpanelPointFetchResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelPointFetchResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_grader_gradingpanel_point_fetch_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGradesGraderGradingpanelPointFetchResponse]:
        """Fetch the data required to display the grader grading panel for simple grading, creating the grade item if required

        Fetch the data required to display the grader grading panel for simple grading, creating the grade item if required

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_grader_gradingpanel_point_fetch_serialize(
            component=component,
            contextid=contextid,
            gradeduserid=gradeduserid,
            itemname=itemname,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelPointFetchResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_grades_grader_gradingpanel_point_fetch_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetch the data required to display the grader grading panel for simple grading, creating the grade item if required

        Fetch the data required to display the grader grading panel for simple grading, creating the grade item if required

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_grader_gradingpanel_point_fetch_serialize(
            component=component,
            contextid=contextid,
            gradeduserid=gradeduserid,
            itemname=itemname,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelPointFetchResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_grades_grader_gradingpanel_point_fetch_serialize(
        self,
        component,
        contextid,
        gradeduserid,
        itemname,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_grades_grader_gradingpanel_point_fetch'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_grades_grader_gradingpanel_point_fetch'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_grades_grader_gradingpanel_point_fetch',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if component is not None:
            _form_params += parse_form({'component': component})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if gradeduserid is not None:
            _form_params += parse_form({'gradeduserid': gradeduserid})
        if itemname is not None:
            _form_params += parse_form({'itemname': itemname})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_grades_grader_gradingpanel_point_store_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        formdata: Annotated[Optional[StrictStr], Field(description="The serialised form data representing the grade")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        notifyuser: Annotated[Optional[StrictBool], Field(description="Wheteher to notify the user or not")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Store the data required to display the grader grading panel for simple grading

        Store the data required to display the grader grading panel for simple grading

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param formdata: The serialised form data representing the grade (required)
        :type formdata: str
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param notifyuser: Wheteher to notify the user or not
        :type notifyuser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_grader_gradingpanel_point_store_serialize(
            component=component,
            contextid=contextid,
            formdata=formdata,
            gradeduserid=gradeduserid,
            itemname=itemname,
            notifyuser=notifyuser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelPointStoreResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_grades_grader_gradingpanel_point_store(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        formdata: Annotated[Optional[StrictStr], Field(description="The serialised form data representing the grade")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        notifyuser: Annotated[Optional[StrictBool], Field(description="Wheteher to notify the user or not")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGradesGraderGradingpanelPointStoreResponse:
        """Store the data required to display the grader grading panel for simple grading

        Store the data required to display the grader grading panel for simple grading

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param formdata: The serialised form data representing the grade (required)
        :type formdata: str
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param notifyuser: Wheteher to notify the user or not
        :type notifyuser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_grader_gradingpanel_point_store_serialize(
            component=component,
            contextid=contextid,
            formdata=formdata,
            gradeduserid=gradeduserid,
            itemname=itemname,
            notifyuser=notifyuser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelPointStoreResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_grader_gradingpanel_point_store_from_args(
        self,
        args
    ) -> CoreGradesGraderGradingpanelPointStoreResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelPointStoreResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_grader_gradingpanel_point_store_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        formdata: Annotated[Optional[StrictStr], Field(description="The serialised form data representing the grade")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        notifyuser: Annotated[Optional[StrictBool], Field(description="Wheteher to notify the user or not")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGradesGraderGradingpanelPointStoreResponse]:
        """Store the data required to display the grader grading panel for simple grading

        Store the data required to display the grader grading panel for simple grading

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param formdata: The serialised form data representing the grade (required)
        :type formdata: str
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param notifyuser: Wheteher to notify the user or not
        :type notifyuser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_grader_gradingpanel_point_store_serialize(
            component=component,
            contextid=contextid,
            formdata=formdata,
            gradeduserid=gradeduserid,
            itemname=itemname,
            notifyuser=notifyuser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelPointStoreResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_grades_grader_gradingpanel_point_store_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        formdata: Annotated[Optional[StrictStr], Field(description="The serialised form data representing the grade")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        notifyuser: Annotated[Optional[StrictBool], Field(description="Wheteher to notify the user or not")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Store the data required to display the grader grading panel for simple grading

        Store the data required to display the grader grading panel for simple grading

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param formdata: The serialised form data representing the grade (required)
        :type formdata: str
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param notifyuser: Wheteher to notify the user or not
        :type notifyuser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_grader_gradingpanel_point_store_serialize(
            component=component,
            contextid=contextid,
            formdata=formdata,
            gradeduserid=gradeduserid,
            itemname=itemname,
            notifyuser=notifyuser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelPointStoreResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_grades_grader_gradingpanel_point_store_serialize(
        self,
        component,
        contextid,
        formdata,
        gradeduserid,
        itemname,
        notifyuser,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_grades_grader_gradingpanel_point_store'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_grades_grader_gradingpanel_point_store'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_grades_grader_gradingpanel_point_store',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if component is not None:
            _form_params += parse_form({'component': component})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if formdata is not None:
            _form_params += parse_form({'formdata': formdata})
        if gradeduserid is not None:
            _form_params += parse_form({'gradeduserid': gradeduserid})
        if itemname is not None:
            _form_params += parse_form({'itemname': itemname})
        if notifyuser is not None:
            _form_params += parse_form({'notifyuser': notifyuser})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_grades_grader_gradingpanel_scale_fetch_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetch the data required to display the grader grading panel for scale-based grading, creating the grade item if required

        Fetch the data required to display the grader grading panel for scale-based grading, creating the grade item if required

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_grader_gradingpanel_scale_fetch_serialize(
            component=component,
            contextid=contextid,
            gradeduserid=gradeduserid,
            itemname=itemname,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelScaleFetchResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_grades_grader_gradingpanel_scale_fetch(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGradesGraderGradingpanelScaleFetchResponse:
        """Fetch the data required to display the grader grading panel for scale-based grading, creating the grade item if required

        Fetch the data required to display the grader grading panel for scale-based grading, creating the grade item if required

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_grader_gradingpanel_scale_fetch_serialize(
            component=component,
            contextid=contextid,
            gradeduserid=gradeduserid,
            itemname=itemname,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelScaleFetchResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_grader_gradingpanel_scale_fetch_from_args(
        self,
        args
    ) -> CoreGradesGraderGradingpanelScaleFetchResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelScaleFetchResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_grader_gradingpanel_scale_fetch_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGradesGraderGradingpanelScaleFetchResponse]:
        """Fetch the data required to display the grader grading panel for scale-based grading, creating the grade item if required

        Fetch the data required to display the grader grading panel for scale-based grading, creating the grade item if required

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_grader_gradingpanel_scale_fetch_serialize(
            component=component,
            contextid=contextid,
            gradeduserid=gradeduserid,
            itemname=itemname,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelScaleFetchResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_grades_grader_gradingpanel_scale_fetch_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetch the data required to display the grader grading panel for scale-based grading, creating the grade item if required

        Fetch the data required to display the grader grading panel for scale-based grading, creating the grade item if required

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_grader_gradingpanel_scale_fetch_serialize(
            component=component,
            contextid=contextid,
            gradeduserid=gradeduserid,
            itemname=itemname,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelScaleFetchResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_grades_grader_gradingpanel_scale_fetch_serialize(
        self,
        component,
        contextid,
        gradeduserid,
        itemname,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_grades_grader_gradingpanel_scale_fetch'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_grades_grader_gradingpanel_scale_fetch'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_grades_grader_gradingpanel_scale_fetch',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if component is not None:
            _form_params += parse_form({'component': component})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if gradeduserid is not None:
            _form_params += parse_form({'gradeduserid': gradeduserid})
        if itemname is not None:
            _form_params += parse_form({'itemname': itemname})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_grades_grader_gradingpanel_scale_store_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        formdata: Annotated[Optional[StrictStr], Field(description="The serialised form data representing the grade")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        notifyuser: Annotated[Optional[StrictBool], Field(description="Wheteher to notify the user or not")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Store the data required to display the grader grading panel for scale-based grading

        Store the data required to display the grader grading panel for scale-based grading

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param formdata: The serialised form data representing the grade (required)
        :type formdata: str
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param notifyuser: Wheteher to notify the user or not
        :type notifyuser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_grader_gradingpanel_scale_store_serialize(
            component=component,
            contextid=contextid,
            formdata=formdata,
            gradeduserid=gradeduserid,
            itemname=itemname,
            notifyuser=notifyuser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelScaleStoreResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_grades_grader_gradingpanel_scale_store(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        formdata: Annotated[Optional[StrictStr], Field(description="The serialised form data representing the grade")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        notifyuser: Annotated[Optional[StrictBool], Field(description="Wheteher to notify the user or not")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGradesGraderGradingpanelScaleStoreResponse:
        """Store the data required to display the grader grading panel for scale-based grading

        Store the data required to display the grader grading panel for scale-based grading

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param formdata: The serialised form data representing the grade (required)
        :type formdata: str
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param notifyuser: Wheteher to notify the user or not
        :type notifyuser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_grader_gradingpanel_scale_store_serialize(
            component=component,
            contextid=contextid,
            formdata=formdata,
            gradeduserid=gradeduserid,
            itemname=itemname,
            notifyuser=notifyuser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelScaleStoreResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_grader_gradingpanel_scale_store_from_args(
        self,
        args
    ) -> CoreGradesGraderGradingpanelScaleStoreResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelScaleStoreResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_grader_gradingpanel_scale_store_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        formdata: Annotated[Optional[StrictStr], Field(description="The serialised form data representing the grade")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        notifyuser: Annotated[Optional[StrictBool], Field(description="Wheteher to notify the user or not")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGradesGraderGradingpanelScaleStoreResponse]:
        """Store the data required to display the grader grading panel for scale-based grading

        Store the data required to display the grader grading panel for scale-based grading

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param formdata: The serialised form data representing the grade (required)
        :type formdata: str
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param notifyuser: Wheteher to notify the user or not
        :type notifyuser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_grader_gradingpanel_scale_store_serialize(
            component=component,
            contextid=contextid,
            formdata=formdata,
            gradeduserid=gradeduserid,
            itemname=itemname,
            notifyuser=notifyuser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelScaleStoreResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_grades_grader_gradingpanel_scale_store_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        formdata: Annotated[Optional[StrictStr], Field(description="The serialised form data representing the grade")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        notifyuser: Annotated[Optional[StrictBool], Field(description="Wheteher to notify the user or not")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Store the data required to display the grader grading panel for scale-based grading

        Store the data required to display the grader grading panel for scale-based grading

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param formdata: The serialised form data representing the grade (required)
        :type formdata: str
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param notifyuser: Wheteher to notify the user or not
        :type notifyuser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_grader_gradingpanel_scale_store_serialize(
            component=component,
            contextid=contextid,
            formdata=formdata,
            gradeduserid=gradeduserid,
            itemname=itemname,
            notifyuser=notifyuser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradesGraderGradingpanelScaleStoreResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_grades_grader_gradingpanel_scale_store_serialize(
        self,
        component,
        contextid,
        formdata,
        gradeduserid,
        itemname,
        notifyuser,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_grades_grader_gradingpanel_scale_store'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_grades_grader_gradingpanel_scale_store'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_grades_grader_gradingpanel_scale_store',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if component is not None:
            _form_params += parse_form({'component': component})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if formdata is not None:
            _form_params += parse_form({'formdata': formdata})
        if gradeduserid is not None:
            _form_params += parse_form({'gradeduserid': gradeduserid})
        if itemname is not None:
            _form_params += parse_form({'itemname': itemname})
        if notifyuser is not None:
            _form_params += parse_form({'notifyuser': notifyuser})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_grades_update_grades_args(
        self,
        activityid: Annotated[Optional[StrictInt], Field(description="The activity ID")],
        component: Annotated[Optional[StrictStr], Field(description="A component, for example mod_forum or mod_quiz")],
        courseid: Annotated[Optional[StrictInt], Field(description="id of course")],
        itemnumber: Annotated[Optional[StrictInt], Field(description="grade item ID number for modules that have multiple grades. Typically this is 0.")],
        source: Annotated[Optional[StrictStr], Field(description="The source of the grade update")],
        grades: Annotated[Optional[List[CoreGradesUpdateGradesParametersGradesInner]], Field(description="Any student grades to alter")] = None,
        itemdetails: Optional[CoreGradesUpdateGradesParametersItemdetails] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update a grade item and associated student grades.

        Update a grade item and associated student grades.

        :param activityid: The activity ID (required)
        :type activityid: int
        :param component: A component, for example mod_forum or mod_quiz (required)
        :type component: str
        :param courseid: id of course (required)
        :type courseid: int
        :param itemnumber: grade item ID number for modules that have multiple grades. Typically this is 0. (required)
        :type itemnumber: int
        :param source: The source of the grade update (required)
        :type source: str
        :param grades: Any student grades to alter
        :type grades: List[CoreGradesUpdateGradesParametersGradesInner]
        :param itemdetails:
        :type itemdetails: CoreGradesUpdateGradesParametersItemdetails
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_update_grades_serialize(
            activityid=activityid,
            component=component,
            courseid=courseid,
            itemnumber=itemnumber,
            source=source,
            grades=grades,
            itemdetails=itemdetails,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_grades_update_grades(
        self,
        activityid: Annotated[Optional[StrictInt], Field(description="The activity ID")],
        component: Annotated[Optional[StrictStr], Field(description="A component, for example mod_forum or mod_quiz")],
        courseid: Annotated[Optional[StrictInt], Field(description="id of course")],
        itemnumber: Annotated[Optional[StrictInt], Field(description="grade item ID number for modules that have multiple grades. Typically this is 0.")],
        source: Annotated[Optional[StrictStr], Field(description="The source of the grade update")],
        grades: Annotated[Optional[List[CoreGradesUpdateGradesParametersGradesInner]], Field(description="Any student grades to alter")] = None,
        itemdetails: Optional[CoreGradesUpdateGradesParametersItemdetails] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> int:
        """Update a grade item and associated student grades.

        Update a grade item and associated student grades.

        :param activityid: The activity ID (required)
        :type activityid: int
        :param component: A component, for example mod_forum or mod_quiz (required)
        :type component: str
        :param courseid: id of course (required)
        :type courseid: int
        :param itemnumber: grade item ID number for modules that have multiple grades. Typically this is 0. (required)
        :type itemnumber: int
        :param source: The source of the grade update (required)
        :type source: str
        :param grades: Any student grades to alter
        :type grades: List[CoreGradesUpdateGradesParametersGradesInner]
        :param itemdetails:
        :type itemdetails: CoreGradesUpdateGradesParametersItemdetails
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_update_grades_serialize(
            activityid=activityid,
            component=component,
            courseid=courseid,
            itemnumber=itemnumber,
            source=source,
            grades=grades,
            itemdetails=itemdetails,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_update_grades_from_args(
        self,
        args
    ) -> int:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grades_update_grades_with_http_info(
        self,
        activityid: Annotated[Optional[StrictInt], Field(description="The activity ID")],
        component: Annotated[Optional[StrictStr], Field(description="A component, for example mod_forum or mod_quiz")],
        courseid: Annotated[Optional[StrictInt], Field(description="id of course")],
        itemnumber: Annotated[Optional[StrictInt], Field(description="grade item ID number for modules that have multiple grades. Typically this is 0.")],
        source: Annotated[Optional[StrictStr], Field(description="The source of the grade update")],
        grades: Annotated[Optional[List[CoreGradesUpdateGradesParametersGradesInner]], Field(description="Any student grades to alter")] = None,
        itemdetails: Optional[CoreGradesUpdateGradesParametersItemdetails] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[int]:
        """Update a grade item and associated student grades.

        Update a grade item and associated student grades.

        :param activityid: The activity ID (required)
        :type activityid: int
        :param component: A component, for example mod_forum or mod_quiz (required)
        :type component: str
        :param courseid: id of course (required)
        :type courseid: int
        :param itemnumber: grade item ID number for modules that have multiple grades. Typically this is 0. (required)
        :type itemnumber: int
        :param source: The source of the grade update (required)
        :type source: str
        :param grades: Any student grades to alter
        :type grades: List[CoreGradesUpdateGradesParametersGradesInner]
        :param itemdetails:
        :type itemdetails: CoreGradesUpdateGradesParametersItemdetails
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_update_grades_serialize(
            activityid=activityid,
            component=component,
            courseid=courseid,
            itemnumber=itemnumber,
            source=source,
            grades=grades,
            itemdetails=itemdetails,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_grades_update_grades_without_preload_content(
        self,
        activityid: Annotated[Optional[StrictInt], Field(description="The activity ID")],
        component: Annotated[Optional[StrictStr], Field(description="A component, for example mod_forum or mod_quiz")],
        courseid: Annotated[Optional[StrictInt], Field(description="id of course")],
        itemnumber: Annotated[Optional[StrictInt], Field(description="grade item ID number for modules that have multiple grades. Typically this is 0.")],
        source: Annotated[Optional[StrictStr], Field(description="The source of the grade update")],
        grades: Annotated[Optional[List[CoreGradesUpdateGradesParametersGradesInner]], Field(description="Any student grades to alter")] = None,
        itemdetails: Optional[CoreGradesUpdateGradesParametersItemdetails] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update a grade item and associated student grades.

        Update a grade item and associated student grades.

        :param activityid: The activity ID (required)
        :type activityid: int
        :param component: A component, for example mod_forum or mod_quiz (required)
        :type component: str
        :param courseid: id of course (required)
        :type courseid: int
        :param itemnumber: grade item ID number for modules that have multiple grades. Typically this is 0. (required)
        :type itemnumber: int
        :param source: The source of the grade update (required)
        :type source: str
        :param grades: Any student grades to alter
        :type grades: List[CoreGradesUpdateGradesParametersGradesInner]
        :param itemdetails:
        :type itemdetails: CoreGradesUpdateGradesParametersItemdetails
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grades_update_grades_serialize(
            activityid=activityid,
            component=component,
            courseid=courseid,
            itemnumber=itemnumber,
            source=source,
            grades=grades,
            itemdetails=itemdetails,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_grades_update_grades_serialize(
        self,
        activityid,
        component,
        courseid,
        itemnumber,
        source,
        grades,
        itemdetails,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'grades': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_grades_update_grades'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_grades_update_grades'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_grades_update_grades',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if activityid is not None:
            _form_params += parse_form({'activityid': activityid})
        if component is not None:
            _form_params += parse_form({'component': component})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if grades is not None:
            _form_params += parse_form({'grades': grades})
        if itemdetails is not None:
            _form_params += parse_form({'itemdetails': itemdetails})
        if itemnumber is not None:
            _form_params += parse_form({'itemnumber': itemnumber})
        if source is not None:
            _form_params += parse_form({'source': source})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_grading_get_definitions_args(
        self,
        areaname: Annotated[Optional[StrictStr], Field(description="area name")],
        cmids: Annotated[List[Optional[StrictInt]], Field(description="1 or more course module ids")],
        activeonly: Annotated[Optional[StrictBool], Field(description="Only the active method")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get grading definitions

        Get grading definitions

        :param areaname: area name (required)
        :type areaname: str
        :param cmids: 1 or more course module ids (required)
        :type cmids: List[Optional[int]]
        :param activeonly: Only the active method
        :type activeonly: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grading_get_definitions_serialize(
            areaname=areaname,
            cmids=cmids,
            activeonly=activeonly,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradingGetDefinitionsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_grading_get_definitions(
        self,
        areaname: Annotated[Optional[StrictStr], Field(description="area name")],
        cmids: Annotated[List[Optional[StrictInt]], Field(description="1 or more course module ids")],
        activeonly: Annotated[Optional[StrictBool], Field(description="Only the active method")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGradingGetDefinitionsResponse:
        """Get grading definitions

        Get grading definitions

        :param areaname: area name (required)
        :type areaname: str
        :param cmids: 1 or more course module ids (required)
        :type cmids: List[Optional[int]]
        :param activeonly: Only the active method
        :type activeonly: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grading_get_definitions_serialize(
            areaname=areaname,
            cmids=cmids,
            activeonly=activeonly,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradingGetDefinitionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grading_get_definitions_from_args(
        self,
        args
    ) -> CoreGradingGetDefinitionsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradingGetDefinitionsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grading_get_definitions_with_http_info(
        self,
        areaname: Annotated[Optional[StrictStr], Field(description="area name")],
        cmids: Annotated[List[Optional[StrictInt]], Field(description="1 or more course module ids")],
        activeonly: Annotated[Optional[StrictBool], Field(description="Only the active method")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGradingGetDefinitionsResponse]:
        """Get grading definitions

        Get grading definitions

        :param areaname: area name (required)
        :type areaname: str
        :param cmids: 1 or more course module ids (required)
        :type cmids: List[Optional[int]]
        :param activeonly: Only the active method
        :type activeonly: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grading_get_definitions_serialize(
            areaname=areaname,
            cmids=cmids,
            activeonly=activeonly,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradingGetDefinitionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_grading_get_definitions_without_preload_content(
        self,
        areaname: Annotated[Optional[StrictStr], Field(description="area name")],
        cmids: Annotated[List[Optional[StrictInt]], Field(description="1 or more course module ids")],
        activeonly: Annotated[Optional[StrictBool], Field(description="Only the active method")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get grading definitions

        Get grading definitions

        :param areaname: area name (required)
        :type areaname: str
        :param cmids: 1 or more course module ids (required)
        :type cmids: List[Optional[int]]
        :param activeonly: Only the active method
        :type activeonly: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grading_get_definitions_serialize(
            areaname=areaname,
            cmids=cmids,
            activeonly=activeonly,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradingGetDefinitionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_grading_get_definitions_serialize(
        self,
        areaname,
        cmids,
        activeonly,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'cmids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_grading_get_definitions'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_grading_get_definitions'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_grading_get_definitions',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if activeonly is not None:
            _form_params += parse_form({'activeonly': activeonly})
        if areaname is not None:
            _form_params += parse_form({'areaname': areaname})
        if cmids is not None:
            _form_params += parse_form({'cmids': cmids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_grading_get_gradingform_instances_args(
        self,
        definitionid: Annotated[Optional[StrictInt], Field(description="definition id")],
        since: Annotated[Optional[StrictInt], Field(description="submitted since")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get grading form instances

        Get grading form instances

        :param definitionid: definition id (required)
        :type definitionid: int
        :param since: submitted since
        :type since: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grading_get_gradingform_instances_serialize(
            definitionid=definitionid,
            since=since,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradingGetGradingformInstancesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_grading_get_gradingform_instances(
        self,
        definitionid: Annotated[Optional[StrictInt], Field(description="definition id")],
        since: Annotated[Optional[StrictInt], Field(description="submitted since")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGradingGetGradingformInstancesResponse:
        """Get grading form instances

        Get grading form instances

        :param definitionid: definition id (required)
        :type definitionid: int
        :param since: submitted since
        :type since: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grading_get_gradingform_instances_serialize(
            definitionid=definitionid,
            since=since,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradingGetGradingformInstancesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grading_get_gradingform_instances_from_args(
        self,
        args
    ) -> CoreGradingGetGradingformInstancesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradingGetGradingformInstancesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grading_get_gradingform_instances_with_http_info(
        self,
        definitionid: Annotated[Optional[StrictInt], Field(description="definition id")],
        since: Annotated[Optional[StrictInt], Field(description="submitted since")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGradingGetGradingformInstancesResponse]:
        """Get grading form instances

        Get grading form instances

        :param definitionid: definition id (required)
        :type definitionid: int
        :param since: submitted since
        :type since: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grading_get_gradingform_instances_serialize(
            definitionid=definitionid,
            since=since,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradingGetGradingformInstancesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_grading_get_gradingform_instances_without_preload_content(
        self,
        definitionid: Annotated[Optional[StrictInt], Field(description="definition id")],
        since: Annotated[Optional[StrictInt], Field(description="submitted since")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get grading form instances

        Get grading form instances

        :param definitionid: definition id (required)
        :type definitionid: int
        :param since: submitted since
        :type since: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grading_get_gradingform_instances_serialize(
            definitionid=definitionid,
            since=since,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGradingGetGradingformInstancesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_grading_get_gradingform_instances_serialize(
        self,
        definitionid,
        since,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_grading_get_gradingform_instances'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_grading_get_gradingform_instances'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_grading_get_gradingform_instances',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if definitionid is not None:
            _form_params += parse_form({'definitionid': definitionid})
        if since is not None:
            _form_params += parse_form({'since': since})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_grading_save_definitions_args(
        self,
        areas: Annotated[List[CoreGradingGetDefinitionsResponseAreasInner], Field(description="areas with definitions to save")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Save grading definitions

        Save grading definitions

        :param areas: areas with definitions to save (required)
        :type areas: List[CoreGradingGetDefinitionsResponseAreasInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grading_save_definitions_serialize(
            areas=areas,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_grading_save_definitions(
        self,
        areas: Annotated[List[CoreGradingGetDefinitionsResponseAreasInner], Field(description="areas with definitions to save")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Save grading definitions

        Save grading definitions

        :param areas: areas with definitions to save (required)
        :type areas: List[CoreGradingGetDefinitionsResponseAreasInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grading_save_definitions_serialize(
            areas=areas,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grading_save_definitions_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_grading_save_definitions_with_http_info(
        self,
        areas: Annotated[List[CoreGradingGetDefinitionsResponseAreasInner], Field(description="areas with definitions to save")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Save grading definitions

        Save grading definitions

        :param areas: areas with definitions to save (required)
        :type areas: List[CoreGradingGetDefinitionsResponseAreasInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grading_save_definitions_serialize(
            areas=areas,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_grading_save_definitions_without_preload_content(
        self,
        areas: Annotated[List[CoreGradingGetDefinitionsResponseAreasInner], Field(description="areas with definitions to save")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Save grading definitions

        Save grading definitions

        :param areas: areas with definitions to save (required)
        :type areas: List[CoreGradingGetDefinitionsResponseAreasInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_grading_save_definitions_serialize(
            areas=areas,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_grading_save_definitions_serialize(
        self,
        areas,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'areas': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_grading_save_definitions'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_grading_save_definitions'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_grading_save_definitions',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if areas is not None:
            _form_params += parse_form({'areas': areas})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_add_group_members_args(
        self,
        members: List[CoreGroupAddGroupMembersParametersMembersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Adds group members.

        Adds group members.

        :param members: (required)
        :type members: List[CoreGroupAddGroupMembersParametersMembersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_add_group_members_serialize(
            members=members,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_add_group_members(
        self,
        members: List[CoreGroupAddGroupMembersParametersMembersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Adds group members.

        Adds group members.

        :param members: (required)
        :type members: List[CoreGroupAddGroupMembersParametersMembersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_add_group_members_serialize(
            members=members,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_add_group_members_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_add_group_members_with_http_info(
        self,
        members: List[CoreGroupAddGroupMembersParametersMembersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Adds group members.

        Adds group members.

        :param members: (required)
        :type members: List[CoreGroupAddGroupMembersParametersMembersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_add_group_members_serialize(
            members=members,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_add_group_members_without_preload_content(
        self,
        members: List[CoreGroupAddGroupMembersParametersMembersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Adds group members.

        Adds group members.

        :param members: (required)
        :type members: List[CoreGroupAddGroupMembersParametersMembersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_add_group_members_serialize(
            members=members,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_add_group_members_serialize(
        self,
        members,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'members': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_group_add_group_members'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_add_group_members'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_add_group_members',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if members is not None:
            _form_params += parse_form({'members': members})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_assign_grouping_args(
        self,
        assignments: List[CoreGroupAssignGroupingParametersAssignmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Assing groups from groupings

        Assing groups from groupings

        :param assignments: (required)
        :type assignments: List[CoreGroupAssignGroupingParametersAssignmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_assign_grouping_serialize(
            assignments=assignments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_assign_grouping(
        self,
        assignments: List[CoreGroupAssignGroupingParametersAssignmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Assing groups from groupings

        Assing groups from groupings

        :param assignments: (required)
        :type assignments: List[CoreGroupAssignGroupingParametersAssignmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_assign_grouping_serialize(
            assignments=assignments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_assign_grouping_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_assign_grouping_with_http_info(
        self,
        assignments: List[CoreGroupAssignGroupingParametersAssignmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Assing groups from groupings

        Assing groups from groupings

        :param assignments: (required)
        :type assignments: List[CoreGroupAssignGroupingParametersAssignmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_assign_grouping_serialize(
            assignments=assignments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_assign_grouping_without_preload_content(
        self,
        assignments: List[CoreGroupAssignGroupingParametersAssignmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Assing groups from groupings

        Assing groups from groupings

        :param assignments: (required)
        :type assignments: List[CoreGroupAssignGroupingParametersAssignmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_assign_grouping_serialize(
            assignments=assignments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_assign_grouping_serialize(
        self,
        assignments,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'assignments': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_group_assign_grouping'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_assign_grouping'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_assign_grouping',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignments is not None:
            _form_params += parse_form({'assignments': assignments})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_create_groupings_args(
        self,
        groupings: Annotated[List[CoreGroupCreateGroupingsParametersGroupingsInner], Field(description="List of grouping object. A grouping has a courseid, a name and a description.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Creates new groupings

        Creates new groupings

        :param groupings: List of grouping object. A grouping has a courseid, a name and a description. (required)
        :type groupings: List[CoreGroupCreateGroupingsParametersGroupingsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_create_groupings_serialize(
            groupings=groupings,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupCreateGroupingsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_create_groupings(
        self,
        groupings: Annotated[List[CoreGroupCreateGroupingsParametersGroupingsInner], Field(description="List of grouping object. A grouping has a courseid, a name and a description.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreGroupCreateGroupingsResponseInner]:
        """Creates new groupings

        Creates new groupings

        :param groupings: List of grouping object. A grouping has a courseid, a name and a description. (required)
        :type groupings: List[CoreGroupCreateGroupingsParametersGroupingsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_create_groupings_serialize(
            groupings=groupings,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupCreateGroupingsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_create_groupings_from_args(
        self,
        args
    ) -> List[CoreGroupCreateGroupingsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupCreateGroupingsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_create_groupings_with_http_info(
        self,
        groupings: Annotated[List[CoreGroupCreateGroupingsParametersGroupingsInner], Field(description="List of grouping object. A grouping has a courseid, a name and a description.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreGroupCreateGroupingsResponseInner]]:
        """Creates new groupings

        Creates new groupings

        :param groupings: List of grouping object. A grouping has a courseid, a name and a description. (required)
        :type groupings: List[CoreGroupCreateGroupingsParametersGroupingsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_create_groupings_serialize(
            groupings=groupings,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupCreateGroupingsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_create_groupings_without_preload_content(
        self,
        groupings: Annotated[List[CoreGroupCreateGroupingsParametersGroupingsInner], Field(description="List of grouping object. A grouping has a courseid, a name and a description.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Creates new groupings

        Creates new groupings

        :param groupings: List of grouping object. A grouping has a courseid, a name and a description. (required)
        :type groupings: List[CoreGroupCreateGroupingsParametersGroupingsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_create_groupings_serialize(
            groupings=groupings,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupCreateGroupingsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_create_groupings_serialize(
        self,
        groupings,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'groupings': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_group_create_groupings'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_create_groupings'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_create_groupings',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if groupings is not None:
            _form_params += parse_form({'groupings': groupings})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_create_groups_args(
        self,
        groups: Annotated[List[CoreGroupCreateGroupsParametersGroupsInner], Field(description="List of group object. A group has a courseid, a name, a description and an enrolment key.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Creates new groups.

        Creates new groups.

        :param groups: List of group object. A group has a courseid, a name, a description and an enrolment key. (required)
        :type groups: List[CoreGroupCreateGroupsParametersGroupsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_create_groups_serialize(
            groups=groups,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupCreateGroupsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_create_groups(
        self,
        groups: Annotated[List[CoreGroupCreateGroupsParametersGroupsInner], Field(description="List of group object. A group has a courseid, a name, a description and an enrolment key.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreGroupCreateGroupsResponseInner]:
        """Creates new groups.

        Creates new groups.

        :param groups: List of group object. A group has a courseid, a name, a description and an enrolment key. (required)
        :type groups: List[CoreGroupCreateGroupsParametersGroupsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_create_groups_serialize(
            groups=groups,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupCreateGroupsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_create_groups_from_args(
        self,
        args
    ) -> List[CoreGroupCreateGroupsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupCreateGroupsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_create_groups_with_http_info(
        self,
        groups: Annotated[List[CoreGroupCreateGroupsParametersGroupsInner], Field(description="List of group object. A group has a courseid, a name, a description and an enrolment key.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreGroupCreateGroupsResponseInner]]:
        """Creates new groups.

        Creates new groups.

        :param groups: List of group object. A group has a courseid, a name, a description and an enrolment key. (required)
        :type groups: List[CoreGroupCreateGroupsParametersGroupsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_create_groups_serialize(
            groups=groups,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupCreateGroupsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_create_groups_without_preload_content(
        self,
        groups: Annotated[List[CoreGroupCreateGroupsParametersGroupsInner], Field(description="List of group object. A group has a courseid, a name, a description and an enrolment key.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Creates new groups.

        Creates new groups.

        :param groups: List of group object. A group has a courseid, a name, a description and an enrolment key. (required)
        :type groups: List[CoreGroupCreateGroupsParametersGroupsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_create_groups_serialize(
            groups=groups,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupCreateGroupsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_create_groups_serialize(
        self,
        groups,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'groups': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_group_create_groups'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_create_groups'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_create_groups',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if groups is not None:
            _form_params += parse_form({'groups': groups})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_delete_group_members_args(
        self,
        members: List[CoreGroupAddGroupMembersParametersMembersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes group members.

        Deletes group members.

        :param members: (required)
        :type members: List[CoreGroupAddGroupMembersParametersMembersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_delete_group_members_serialize(
            members=members,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_delete_group_members(
        self,
        members: List[CoreGroupAddGroupMembersParametersMembersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Deletes group members.

        Deletes group members.

        :param members: (required)
        :type members: List[CoreGroupAddGroupMembersParametersMembersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_delete_group_members_serialize(
            members=members,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_delete_group_members_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_delete_group_members_with_http_info(
        self,
        members: List[CoreGroupAddGroupMembersParametersMembersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Deletes group members.

        Deletes group members.

        :param members: (required)
        :type members: List[CoreGroupAddGroupMembersParametersMembersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_delete_group_members_serialize(
            members=members,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_delete_group_members_without_preload_content(
        self,
        members: List[CoreGroupAddGroupMembersParametersMembersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes group members.

        Deletes group members.

        :param members: (required)
        :type members: List[CoreGroupAddGroupMembersParametersMembersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_delete_group_members_serialize(
            members=members,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_delete_group_members_serialize(
        self,
        members,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'members': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_group_delete_group_members'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_delete_group_members'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_delete_group_members',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if members is not None:
            _form_params += parse_form({'members': members})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_delete_groupings_args(
        self,
        groupingids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes all specified groupings.

        Deletes all specified groupings.

        :param groupingids: (required)
        :type groupingids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_delete_groupings_serialize(
            groupingids=groupingids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_delete_groupings(
        self,
        groupingids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Deletes all specified groupings.

        Deletes all specified groupings.

        :param groupingids: (required)
        :type groupingids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_delete_groupings_serialize(
            groupingids=groupingids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_delete_groupings_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_delete_groupings_with_http_info(
        self,
        groupingids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Deletes all specified groupings.

        Deletes all specified groupings.

        :param groupingids: (required)
        :type groupingids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_delete_groupings_serialize(
            groupingids=groupingids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_delete_groupings_without_preload_content(
        self,
        groupingids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes all specified groupings.

        Deletes all specified groupings.

        :param groupingids: (required)
        :type groupingids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_delete_groupings_serialize(
            groupingids=groupingids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_delete_groupings_serialize(
        self,
        groupingids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'groupingids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_group_delete_groupings'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_delete_groupings'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_delete_groupings',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if groupingids is not None:
            _form_params += parse_form({'groupingids': groupingids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_delete_groups_args(
        self,
        groupids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes all specified groups.

        Deletes all specified groups.

        :param groupids: (required)
        :type groupids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_delete_groups_serialize(
            groupids=groupids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_delete_groups(
        self,
        groupids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Deletes all specified groups.

        Deletes all specified groups.

        :param groupids: (required)
        :type groupids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_delete_groups_serialize(
            groupids=groupids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_delete_groups_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_delete_groups_with_http_info(
        self,
        groupids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Deletes all specified groups.

        Deletes all specified groups.

        :param groupids: (required)
        :type groupids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_delete_groups_serialize(
            groupids=groupids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_delete_groups_without_preload_content(
        self,
        groupids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes all specified groups.

        Deletes all specified groups.

        :param groupids: (required)
        :type groupids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_delete_groups_serialize(
            groupids=groupids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_delete_groups_serialize(
        self,
        groupids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'groupids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_group_delete_groups'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_delete_groups'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_delete_groups',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if groupids is not None:
            _form_params += parse_form({'groupids': groupids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_get_activity_allowed_groups_args(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        userid: Annotated[Optional[StrictInt], Field(description="id of user, empty for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Gets a list of groups that the user is allowed to access within the specified activity.

        Gets a list of groups that the user is allowed to access within the specified activity.

        :param cmid: course module id (required)
        :type cmid: int
        :param userid: id of user, empty for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_activity_allowed_groups_serialize(
            cmid=cmid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetActivityAllowedGroupsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_get_activity_allowed_groups(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        userid: Annotated[Optional[StrictInt], Field(description="id of user, empty for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGroupGetActivityAllowedGroupsResponse:
        """Gets a list of groups that the user is allowed to access within the specified activity.

        Gets a list of groups that the user is allowed to access within the specified activity.

        :param cmid: course module id (required)
        :type cmid: int
        :param userid: id of user, empty for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_activity_allowed_groups_serialize(
            cmid=cmid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetActivityAllowedGroupsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_activity_allowed_groups_from_args(
        self,
        args
    ) -> CoreGroupGetActivityAllowedGroupsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetActivityAllowedGroupsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_activity_allowed_groups_with_http_info(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        userid: Annotated[Optional[StrictInt], Field(description="id of user, empty for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGroupGetActivityAllowedGroupsResponse]:
        """Gets a list of groups that the user is allowed to access within the specified activity.

        Gets a list of groups that the user is allowed to access within the specified activity.

        :param cmid: course module id (required)
        :type cmid: int
        :param userid: id of user, empty for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_activity_allowed_groups_serialize(
            cmid=cmid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetActivityAllowedGroupsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_get_activity_allowed_groups_without_preload_content(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        userid: Annotated[Optional[StrictInt], Field(description="id of user, empty for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Gets a list of groups that the user is allowed to access within the specified activity.

        Gets a list of groups that the user is allowed to access within the specified activity.

        :param cmid: course module id (required)
        :type cmid: int
        :param userid: id of user, empty for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_activity_allowed_groups_serialize(
            cmid=cmid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetActivityAllowedGroupsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_get_activity_allowed_groups_serialize(
        self,
        cmid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_group_get_activity_allowed_groups'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_get_activity_allowed_groups'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_get_activity_allowed_groups',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_get_activity_groupmode_args(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns effective groupmode used in a given activity.

        Returns effective groupmode used in a given activity.

        :param cmid: course module id (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_activity_groupmode_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetActivityGroupmodeResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_get_activity_groupmode(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGroupGetActivityGroupmodeResponse:
        """Returns effective groupmode used in a given activity.

        Returns effective groupmode used in a given activity.

        :param cmid: course module id (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_activity_groupmode_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetActivityGroupmodeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_activity_groupmode_from_args(
        self,
        args
    ) -> CoreGroupGetActivityGroupmodeResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetActivityGroupmodeResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_activity_groupmode_with_http_info(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGroupGetActivityGroupmodeResponse]:
        """Returns effective groupmode used in a given activity.

        Returns effective groupmode used in a given activity.

        :param cmid: course module id (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_activity_groupmode_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetActivityGroupmodeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_get_activity_groupmode_without_preload_content(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns effective groupmode used in a given activity.

        Returns effective groupmode used in a given activity.

        :param cmid: course module id (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_activity_groupmode_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetActivityGroupmodeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_get_activity_groupmode_serialize(
        self,
        cmid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_group_get_activity_groupmode'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_get_activity_groupmode'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_get_activity_groupmode',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_get_course_groupings_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of course")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns all groupings in specified course.

        Returns all groupings in specified course.

        :param courseid: id of course (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_course_groupings_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetCourseGroupingsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_get_course_groupings(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of course")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreGroupGetCourseGroupingsResponseInner]:
        """Returns all groupings in specified course.

        Returns all groupings in specified course.

        :param courseid: id of course (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_course_groupings_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetCourseGroupingsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_course_groupings_from_args(
        self,
        args
    ) -> List[CoreGroupGetCourseGroupingsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetCourseGroupingsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_course_groupings_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of course")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreGroupGetCourseGroupingsResponseInner]]:
        """Returns all groupings in specified course.

        Returns all groupings in specified course.

        :param courseid: id of course (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_course_groupings_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetCourseGroupingsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_get_course_groupings_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of course")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns all groupings in specified course.

        Returns all groupings in specified course.

        :param courseid: id of course (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_course_groupings_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetCourseGroupingsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_get_course_groupings_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_group_get_course_groupings'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_get_course_groupings'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_get_course_groupings',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_get_course_groups_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of course")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns all groups in specified course.

        Returns all groups in specified course.

        :param courseid: id of course (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_course_groups_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetCourseGroupsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_get_course_groups(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of course")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreGroupGetCourseGroupsResponseInner]:
        """Returns all groups in specified course.

        Returns all groups in specified course.

        :param courseid: id of course (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_course_groups_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetCourseGroupsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_course_groups_from_args(
        self,
        args
    ) -> List[CoreGroupGetCourseGroupsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetCourseGroupsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_course_groups_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of course")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreGroupGetCourseGroupsResponseInner]]:
        """Returns all groups in specified course.

        Returns all groups in specified course.

        :param courseid: id of course (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_course_groups_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetCourseGroupsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_get_course_groups_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of course")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns all groups in specified course.

        Returns all groups in specified course.

        :param courseid: id of course (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_course_groups_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetCourseGroupsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_get_course_groups_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_group_get_course_groups'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_get_course_groups'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_get_course_groups',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_get_course_user_groups_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Id of course (empty or 0 for all the courses where the user is enrolled).")] = None,
        groupingid: Annotated[Optional[StrictInt], Field(description="returns only groups in the specified grouping")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Id of user (empty or 0 for current user).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns all groups in specified course for the specified user.

        Returns all groups in specified course for the specified user.

        :param courseid: Id of course (empty or 0 for all the courses where the user is enrolled).
        :type courseid: int
        :param groupingid: returns only groups in the specified grouping
        :type groupingid: int
        :param userid: Id of user (empty or 0 for current user).
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_course_user_groups_serialize(
            courseid=courseid,
            groupingid=groupingid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetCourseUserGroupsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_get_course_user_groups(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Id of course (empty or 0 for all the courses where the user is enrolled).")] = None,
        groupingid: Annotated[Optional[StrictInt], Field(description="returns only groups in the specified grouping")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Id of user (empty or 0 for current user).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGroupGetCourseUserGroupsResponse:
        """Returns all groups in specified course for the specified user.

        Returns all groups in specified course for the specified user.

        :param courseid: Id of course (empty or 0 for all the courses where the user is enrolled).
        :type courseid: int
        :param groupingid: returns only groups in the specified grouping
        :type groupingid: int
        :param userid: Id of user (empty or 0 for current user).
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_course_user_groups_serialize(
            courseid=courseid,
            groupingid=groupingid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetCourseUserGroupsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_course_user_groups_from_args(
        self,
        args
    ) -> CoreGroupGetCourseUserGroupsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetCourseUserGroupsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_course_user_groups_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Id of course (empty or 0 for all the courses where the user is enrolled).")] = None,
        groupingid: Annotated[Optional[StrictInt], Field(description="returns only groups in the specified grouping")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Id of user (empty or 0 for current user).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGroupGetCourseUserGroupsResponse]:
        """Returns all groups in specified course for the specified user.

        Returns all groups in specified course for the specified user.

        :param courseid: Id of course (empty or 0 for all the courses where the user is enrolled).
        :type courseid: int
        :param groupingid: returns only groups in the specified grouping
        :type groupingid: int
        :param userid: Id of user (empty or 0 for current user).
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_course_user_groups_serialize(
            courseid=courseid,
            groupingid=groupingid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetCourseUserGroupsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_get_course_user_groups_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Id of course (empty or 0 for all the courses where the user is enrolled).")] = None,
        groupingid: Annotated[Optional[StrictInt], Field(description="returns only groups in the specified grouping")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Id of user (empty or 0 for current user).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns all groups in specified course for the specified user.

        Returns all groups in specified course for the specified user.

        :param courseid: Id of course (empty or 0 for all the courses where the user is enrolled).
        :type courseid: int
        :param groupingid: returns only groups in the specified grouping
        :type groupingid: int
        :param userid: Id of user (empty or 0 for current user).
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_course_user_groups_serialize(
            courseid=courseid,
            groupingid=groupingid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetCourseUserGroupsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_get_course_user_groups_serialize(
        self,
        courseid,
        groupingid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_group_get_course_user_groups'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_get_course_user_groups'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_get_course_user_groups',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if groupingid is not None:
            _form_params += parse_form({'groupingid': groupingid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_get_group_members_args(
        self,
        groupids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns group members.

        Returns group members.

        :param groupids: (required)
        :type groupids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_group_members_serialize(
            groupids=groupids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetGroupMembersResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_get_group_members(
        self,
        groupids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreGroupGetGroupMembersResponseInner]:
        """Returns group members.

        Returns group members.

        :param groupids: (required)
        :type groupids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_group_members_serialize(
            groupids=groupids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetGroupMembersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_group_members_from_args(
        self,
        args
    ) -> List[CoreGroupGetGroupMembersResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetGroupMembersResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_group_members_with_http_info(
        self,
        groupids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreGroupGetGroupMembersResponseInner]]:
        """Returns group members.

        Returns group members.

        :param groupids: (required)
        :type groupids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_group_members_serialize(
            groupids=groupids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetGroupMembersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_get_group_members_without_preload_content(
        self,
        groupids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns group members.

        Returns group members.

        :param groupids: (required)
        :type groupids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_group_members_serialize(
            groupids=groupids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetGroupMembersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_get_group_members_serialize(
        self,
        groupids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'groupids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_group_get_group_members'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_get_group_members'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_get_group_members',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if groupids is not None:
            _form_params += parse_form({'groupids': groupids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_get_groupings_args(
        self,
        groupingids: Annotated[List[Optional[StrictInt]], Field(description="List of grouping id. A grouping id is an integer.")],
        returngroups: Annotated[Optional[StrictBool], Field(description="return associated groups")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns groupings details.

        Returns groupings details.

        :param groupingids: List of grouping id. A grouping id is an integer. (required)
        :type groupingids: List[Optional[int]]
        :param returngroups: return associated groups
        :type returngroups: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_groupings_serialize(
            groupingids=groupingids,
            returngroups=returngroups,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetGroupingsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_get_groupings(
        self,
        groupingids: Annotated[List[Optional[StrictInt]], Field(description="List of grouping id. A grouping id is an integer.")],
        returngroups: Annotated[Optional[StrictBool], Field(description="return associated groups")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreGroupGetGroupingsResponseInner]:
        """Returns groupings details.

        Returns groupings details.

        :param groupingids: List of grouping id. A grouping id is an integer. (required)
        :type groupingids: List[Optional[int]]
        :param returngroups: return associated groups
        :type returngroups: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_groupings_serialize(
            groupingids=groupingids,
            returngroups=returngroups,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetGroupingsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_groupings_from_args(
        self,
        args
    ) -> List[CoreGroupGetGroupingsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetGroupingsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_groupings_with_http_info(
        self,
        groupingids: Annotated[List[Optional[StrictInt]], Field(description="List of grouping id. A grouping id is an integer.")],
        returngroups: Annotated[Optional[StrictBool], Field(description="return associated groups")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreGroupGetGroupingsResponseInner]]:
        """Returns groupings details.

        Returns groupings details.

        :param groupingids: List of grouping id. A grouping id is an integer. (required)
        :type groupingids: List[Optional[int]]
        :param returngroups: return associated groups
        :type returngroups: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_groupings_serialize(
            groupingids=groupingids,
            returngroups=returngroups,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetGroupingsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_get_groupings_without_preload_content(
        self,
        groupingids: Annotated[List[Optional[StrictInt]], Field(description="List of grouping id. A grouping id is an integer.")],
        returngroups: Annotated[Optional[StrictBool], Field(description="return associated groups")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns groupings details.

        Returns groupings details.

        :param groupingids: List of grouping id. A grouping id is an integer. (required)
        :type groupingids: List[Optional[int]]
        :param returngroups: return associated groups
        :type returngroups: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_groupings_serialize(
            groupingids=groupingids,
            returngroups=returngroups,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetGroupingsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_get_groupings_serialize(
        self,
        groupingids,
        returngroups,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'groupingids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_group_get_groupings'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_get_groupings'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_get_groupings',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if groupingids is not None:
            _form_params += parse_form({'groupingids': groupingids})
        if returngroups is not None:
            _form_params += parse_form({'returngroups': returngroups})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_get_groups_args(
        self,
        groupids: Annotated[List[Optional[StrictInt]], Field(description="List of group id. A group id is an integer.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns group details.

        Returns group details.

        :param groupids: List of group id. A group id is an integer. (required)
        :type groupids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_groups_serialize(
            groupids=groupids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetGroupsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_get_groups(
        self,
        groupids: Annotated[List[Optional[StrictInt]], Field(description="List of group id. A group id is an integer.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreGroupGetGroupsResponseInner]:
        """Returns group details.

        Returns group details.

        :param groupids: List of group id. A group id is an integer. (required)
        :type groupids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_groups_serialize(
            groupids=groupids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetGroupsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_groups_from_args(
        self,
        args
    ) -> List[CoreGroupGetGroupsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetGroupsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_groups_with_http_info(
        self,
        groupids: Annotated[List[Optional[StrictInt]], Field(description="List of group id. A group id is an integer.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreGroupGetGroupsResponseInner]]:
        """Returns group details.

        Returns group details.

        :param groupids: List of group id. A group id is an integer. (required)
        :type groupids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_groups_serialize(
            groupids=groupids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetGroupsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_get_groups_without_preload_content(
        self,
        groupids: Annotated[List[Optional[StrictInt]], Field(description="List of group id. A group id is an integer.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns group details.

        Returns group details.

        :param groupids: List of group id. A group id is an integer. (required)
        :type groupids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_groups_serialize(
            groupids=groupids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreGroupGetGroupsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_get_groups_serialize(
        self,
        groupids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'groupids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_group_get_groups'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_get_groups'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_get_groups',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if groupids is not None:
            _form_params += parse_form({'groupids': groupids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_get_groups_for_selector_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        cmid: Annotated[Optional[StrictInt], Field(description="Course module Id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the group/(s) for a course

        Get the group/(s) for a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param cmid: Course module Id
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_groups_for_selector_serialize(
            courseid=courseid,
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetGroupsForSelectorResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_get_groups_for_selector(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        cmid: Annotated[Optional[StrictInt], Field(description="Course module Id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreGroupGetGroupsForSelectorResponse:
        """Get the group/(s) for a course

        Get the group/(s) for a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param cmid: Course module Id
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_groups_for_selector_serialize(
            courseid=courseid,
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetGroupsForSelectorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_groups_for_selector_from_args(
        self,
        args
    ) -> CoreGroupGetGroupsForSelectorResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetGroupsForSelectorResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_get_groups_for_selector_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        cmid: Annotated[Optional[StrictInt], Field(description="Course module Id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreGroupGetGroupsForSelectorResponse]:
        """Get the group/(s) for a course

        Get the group/(s) for a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param cmid: Course module Id
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_groups_for_selector_serialize(
            courseid=courseid,
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetGroupsForSelectorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_get_groups_for_selector_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        cmid: Annotated[Optional[StrictInt], Field(description="Course module Id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the group/(s) for a course

        Get the group/(s) for a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param cmid: Course module Id
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_get_groups_for_selector_serialize(
            courseid=courseid,
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreGroupGetGroupsForSelectorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_get_groups_for_selector_serialize(
        self,
        courseid,
        cmid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_group_get_groups_for_selector'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_get_groups_for_selector'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_get_groups_for_selector',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_unassign_grouping_args(
        self,
        unassignments: List[CoreGroupAssignGroupingParametersAssignmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Unassing groups from groupings

        Unassing groups from groupings

        :param unassignments: (required)
        :type unassignments: List[CoreGroupAssignGroupingParametersAssignmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_unassign_grouping_serialize(
            unassignments=unassignments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_unassign_grouping(
        self,
        unassignments: List[CoreGroupAssignGroupingParametersAssignmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Unassing groups from groupings

        Unassing groups from groupings

        :param unassignments: (required)
        :type unassignments: List[CoreGroupAssignGroupingParametersAssignmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_unassign_grouping_serialize(
            unassignments=unassignments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_unassign_grouping_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_unassign_grouping_with_http_info(
        self,
        unassignments: List[CoreGroupAssignGroupingParametersAssignmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Unassing groups from groupings

        Unassing groups from groupings

        :param unassignments: (required)
        :type unassignments: List[CoreGroupAssignGroupingParametersAssignmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_unassign_grouping_serialize(
            unassignments=unassignments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_unassign_grouping_without_preload_content(
        self,
        unassignments: List[CoreGroupAssignGroupingParametersAssignmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Unassing groups from groupings

        Unassing groups from groupings

        :param unassignments: (required)
        :type unassignments: List[CoreGroupAssignGroupingParametersAssignmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_unassign_grouping_serialize(
            unassignments=unassignments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_unassign_grouping_serialize(
        self,
        unassignments,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'unassignments': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_group_unassign_grouping'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_unassign_grouping'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_unassign_grouping',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if unassignments is not None:
            _form_params += parse_form({'unassignments': unassignments})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_update_groupings_args(
        self,
        groupings: Annotated[List[CoreGroupUpdateGroupingsParametersGroupingsInner], Field(description="List of grouping object. A grouping has a courseid, a name and a description.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Updates existing groupings

        Updates existing groupings

        :param groupings: List of grouping object. A grouping has a courseid, a name and a description. (required)
        :type groupings: List[CoreGroupUpdateGroupingsParametersGroupingsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_update_groupings_serialize(
            groupings=groupings,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_update_groupings(
        self,
        groupings: Annotated[List[CoreGroupUpdateGroupingsParametersGroupingsInner], Field(description="List of grouping object. A grouping has a courseid, a name and a description.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Updates existing groupings

        Updates existing groupings

        :param groupings: List of grouping object. A grouping has a courseid, a name and a description. (required)
        :type groupings: List[CoreGroupUpdateGroupingsParametersGroupingsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_update_groupings_serialize(
            groupings=groupings,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_update_groupings_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_update_groupings_with_http_info(
        self,
        groupings: Annotated[List[CoreGroupUpdateGroupingsParametersGroupingsInner], Field(description="List of grouping object. A grouping has a courseid, a name and a description.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Updates existing groupings

        Updates existing groupings

        :param groupings: List of grouping object. A grouping has a courseid, a name and a description. (required)
        :type groupings: List[CoreGroupUpdateGroupingsParametersGroupingsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_update_groupings_serialize(
            groupings=groupings,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_update_groupings_without_preload_content(
        self,
        groupings: Annotated[List[CoreGroupUpdateGroupingsParametersGroupingsInner], Field(description="List of grouping object. A grouping has a courseid, a name and a description.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Updates existing groupings

        Updates existing groupings

        :param groupings: List of grouping object. A grouping has a courseid, a name and a description. (required)
        :type groupings: List[CoreGroupUpdateGroupingsParametersGroupingsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_update_groupings_serialize(
            groupings=groupings,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_update_groupings_serialize(
        self,
        groupings,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'groupings': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_group_update_groupings'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_update_groupings'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_update_groupings',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if groupings is not None:
            _form_params += parse_form({'groupings': groupings})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_group_update_groups_args(
        self,
        groups: Annotated[List[CoreGroupUpdateGroupsParametersGroupsInner], Field(description="List of group objects. A group is found by the id, then all other details provided will be updated.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Updates existing groups.

        Updates existing groups.

        :param groups: List of group objects. A group is found by the id, then all other details provided will be updated. (required)
        :type groups: List[CoreGroupUpdateGroupsParametersGroupsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_update_groups_serialize(
            groups=groups,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_group_update_groups(
        self,
        groups: Annotated[List[CoreGroupUpdateGroupsParametersGroupsInner], Field(description="List of group objects. A group is found by the id, then all other details provided will be updated.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Updates existing groups.

        Updates existing groups.

        :param groups: List of group objects. A group is found by the id, then all other details provided will be updated. (required)
        :type groups: List[CoreGroupUpdateGroupsParametersGroupsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_update_groups_serialize(
            groups=groups,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_update_groups_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_group_update_groups_with_http_info(
        self,
        groups: Annotated[List[CoreGroupUpdateGroupsParametersGroupsInner], Field(description="List of group objects. A group is found by the id, then all other details provided will be updated.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Updates existing groups.

        Updates existing groups.

        :param groups: List of group objects. A group is found by the id, then all other details provided will be updated. (required)
        :type groups: List[CoreGroupUpdateGroupsParametersGroupsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_update_groups_serialize(
            groups=groups,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_group_update_groups_without_preload_content(
        self,
        groups: Annotated[List[CoreGroupUpdateGroupsParametersGroupsInner], Field(description="List of group objects. A group is found by the id, then all other details provided will be updated.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Updates existing groups.

        Updates existing groups.

        :param groups: List of group objects. A group is found by the id, then all other details provided will be updated. (required)
        :type groups: List[CoreGroupUpdateGroupsParametersGroupsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_group_update_groups_serialize(
            groups=groups,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_group_update_groups_serialize(
        self,
        groups,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'groups': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_group_update_groups'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_group_update_groups'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_group_update_groups',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if groups is not None:
            _form_params += parse_form({'groups': groups})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_h5p_get_trusted_h5p_file_args(
        self,
        url: Annotated[Optional[StrictStr], Field(description="H5P file url.")],
        copyright: Annotated[Optional[StrictInt], Field(description="The copyright option")] = None,
        embed: Annotated[Optional[StrictInt], Field(description="The embed allow to copy the code to your site")] = None,
        export: Annotated[Optional[StrictInt], Field(description="The export allow to download the package")] = None,
        frame: Annotated[Optional[StrictInt], Field(description="The frame allow to show the bar options below the content")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the H5P file cleaned for Mobile App.

        Get the H5P file cleaned for Mobile App.

        :param url: H5P file url. (required)
        :type url: str
        :param copyright: The copyright option
        :type copyright: int
        :param embed: The embed allow to copy the code to your site
        :type embed: int
        :param export: The export allow to download the package
        :type export: int
        :param frame: The frame allow to show the bar options below the content
        :type frame: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_h5p_get_trusted_h5p_file_serialize(
            url=url,
            copyright=copyright,
            embed=embed,
            export=export,
            frame=frame,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreH5pGetTrustedH5pFileResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_h5p_get_trusted_h5p_file(
        self,
        url: Annotated[Optional[StrictStr], Field(description="H5P file url.")],
        copyright: Annotated[Optional[StrictInt], Field(description="The copyright option")] = None,
        embed: Annotated[Optional[StrictInt], Field(description="The embed allow to copy the code to your site")] = None,
        export: Annotated[Optional[StrictInt], Field(description="The export allow to download the package")] = None,
        frame: Annotated[Optional[StrictInt], Field(description="The frame allow to show the bar options below the content")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreH5pGetTrustedH5pFileResponse:
        """Get the H5P file cleaned for Mobile App.

        Get the H5P file cleaned for Mobile App.

        :param url: H5P file url. (required)
        :type url: str
        :param copyright: The copyright option
        :type copyright: int
        :param embed: The embed allow to copy the code to your site
        :type embed: int
        :param export: The export allow to download the package
        :type export: int
        :param frame: The frame allow to show the bar options below the content
        :type frame: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_h5p_get_trusted_h5p_file_serialize(
            url=url,
            copyright=copyright,
            embed=embed,
            export=export,
            frame=frame,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreH5pGetTrustedH5pFileResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_h5p_get_trusted_h5p_file_from_args(
        self,
        args
    ) -> CoreH5pGetTrustedH5pFileResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreH5pGetTrustedH5pFileResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_h5p_get_trusted_h5p_file_with_http_info(
        self,
        url: Annotated[Optional[StrictStr], Field(description="H5P file url.")],
        copyright: Annotated[Optional[StrictInt], Field(description="The copyright option")] = None,
        embed: Annotated[Optional[StrictInt], Field(description="The embed allow to copy the code to your site")] = None,
        export: Annotated[Optional[StrictInt], Field(description="The export allow to download the package")] = None,
        frame: Annotated[Optional[StrictInt], Field(description="The frame allow to show the bar options below the content")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreH5pGetTrustedH5pFileResponse]:
        """Get the H5P file cleaned for Mobile App.

        Get the H5P file cleaned for Mobile App.

        :param url: H5P file url. (required)
        :type url: str
        :param copyright: The copyright option
        :type copyright: int
        :param embed: The embed allow to copy the code to your site
        :type embed: int
        :param export: The export allow to download the package
        :type export: int
        :param frame: The frame allow to show the bar options below the content
        :type frame: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_h5p_get_trusted_h5p_file_serialize(
            url=url,
            copyright=copyright,
            embed=embed,
            export=export,
            frame=frame,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreH5pGetTrustedH5pFileResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_h5p_get_trusted_h5p_file_without_preload_content(
        self,
        url: Annotated[Optional[StrictStr], Field(description="H5P file url.")],
        copyright: Annotated[Optional[StrictInt], Field(description="The copyright option")] = None,
        embed: Annotated[Optional[StrictInt], Field(description="The embed allow to copy the code to your site")] = None,
        export: Annotated[Optional[StrictInt], Field(description="The export allow to download the package")] = None,
        frame: Annotated[Optional[StrictInt], Field(description="The frame allow to show the bar options below the content")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the H5P file cleaned for Mobile App.

        Get the H5P file cleaned for Mobile App.

        :param url: H5P file url. (required)
        :type url: str
        :param copyright: The copyright option
        :type copyright: int
        :param embed: The embed allow to copy the code to your site
        :type embed: int
        :param export: The export allow to download the package
        :type export: int
        :param frame: The frame allow to show the bar options below the content
        :type frame: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_h5p_get_trusted_h5p_file_serialize(
            url=url,
            copyright=copyright,
            embed=embed,
            export=export,
            frame=frame,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreH5pGetTrustedH5pFileResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_h5p_get_trusted_h5p_file_serialize(
        self,
        url,
        copyright,
        embed,
        export,
        frame,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_h5p_get_trusted_h5p_file'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_h5p_get_trusted_h5p_file'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_h5p_get_trusted_h5p_file',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if copyright is not None:
            _form_params += parse_form({'copyright': copyright})
        if embed is not None:
            _form_params += parse_form({'embed': embed})
        if export is not None:
            _form_params += parse_form({'export': export})
        if frame is not None:
            _form_params += parse_form({'frame': frame})
        if url is not None:
            _form_params += parse_form({'url': url})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_block_user_args(
        self,
        blockeduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being blocked")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is blocking")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Blocks a user

        Blocks a user

        :param blockeduserid: The id of the user being blocked (required)
        :type blockeduserid: int
        :param userid: The id of the user who is blocking (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_block_user_serialize(
            blockeduserid=blockeduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_block_user(
        self,
        blockeduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being blocked")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is blocking")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Blocks a user

        Blocks a user

        :param blockeduserid: The id of the user being blocked (required)
        :type blockeduserid: int
        :param userid: The id of the user who is blocking (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_block_user_serialize(
            blockeduserid=blockeduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_block_user_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_block_user_with_http_info(
        self,
        blockeduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being blocked")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is blocking")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Blocks a user

        Blocks a user

        :param blockeduserid: The id of the user being blocked (required)
        :type blockeduserid: int
        :param userid: The id of the user who is blocking (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_block_user_serialize(
            blockeduserid=blockeduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_block_user_without_preload_content(
        self,
        blockeduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being blocked")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is blocking")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Blocks a user

        Blocks a user

        :param blockeduserid: The id of the user being blocked (required)
        :type blockeduserid: int
        :param userid: The id of the user who is blocking (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_block_user_serialize(
            blockeduserid=blockeduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_block_user_serialize(
        self,
        blockeduserid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_block_user'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_block_user'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_block_user',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if blockeduserid is not None:
            _form_params += parse_form({'blockeduserid': blockeduserid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_confirm_contact_request_args(
        self,
        requesteduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being requested")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user making the request")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Confirms a contact request

        Confirms a contact request

        :param requesteduserid: The id of the user being requested (required)
        :type requesteduserid: int
        :param userid: The id of the user making the request (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_confirm_contact_request_serialize(
            requesteduserid=requesteduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_confirm_contact_request(
        self,
        requesteduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being requested")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user making the request")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Confirms a contact request

        Confirms a contact request

        :param requesteduserid: The id of the user being requested (required)
        :type requesteduserid: int
        :param userid: The id of the user making the request (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_confirm_contact_request_serialize(
            requesteduserid=requesteduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_confirm_contact_request_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_confirm_contact_request_with_http_info(
        self,
        requesteduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being requested")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user making the request")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Confirms a contact request

        Confirms a contact request

        :param requesteduserid: The id of the user being requested (required)
        :type requesteduserid: int
        :param userid: The id of the user making the request (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_confirm_contact_request_serialize(
            requesteduserid=requesteduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_confirm_contact_request_without_preload_content(
        self,
        requesteduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being requested")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user making the request")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Confirms a contact request

        Confirms a contact request

        :param requesteduserid: The id of the user being requested (required)
        :type requesteduserid: int
        :param userid: The id of the user making the request (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_confirm_contact_request_serialize(
            requesteduserid=requesteduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_confirm_contact_request_serialize(
        self,
        requesteduserid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_confirm_contact_request'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_confirm_contact_request'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_confirm_contact_request',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if requesteduserid is not None:
            _form_params += parse_form({'requesteduserid': requesteduserid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_create_contact_request_args(
        self,
        requesteduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being requested")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user making the request")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Creates a contact request

        Creates a contact request

        :param requesteduserid: The id of the user being requested (required)
        :type requesteduserid: int
        :param userid: The id of the user making the request (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_create_contact_request_serialize(
            requesteduserid=requesteduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageCreateContactRequestResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_create_contact_request(
        self,
        requesteduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being requested")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user making the request")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageCreateContactRequestResponse:
        """Creates a contact request

        Creates a contact request

        :param requesteduserid: The id of the user being requested (required)
        :type requesteduserid: int
        :param userid: The id of the user making the request (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_create_contact_request_serialize(
            requesteduserid=requesteduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageCreateContactRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_create_contact_request_from_args(
        self,
        args
    ) -> CoreMessageCreateContactRequestResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageCreateContactRequestResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_create_contact_request_with_http_info(
        self,
        requesteduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being requested")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user making the request")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageCreateContactRequestResponse]:
        """Creates a contact request

        Creates a contact request

        :param requesteduserid: The id of the user being requested (required)
        :type requesteduserid: int
        :param userid: The id of the user making the request (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_create_contact_request_serialize(
            requesteduserid=requesteduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageCreateContactRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_create_contact_request_without_preload_content(
        self,
        requesteduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being requested")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user making the request")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Creates a contact request

        Creates a contact request

        :param requesteduserid: The id of the user being requested (required)
        :type requesteduserid: int
        :param userid: The id of the user making the request (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_create_contact_request_serialize(
            requesteduserid=requesteduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageCreateContactRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_create_contact_request_serialize(
        self,
        requesteduserid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_create_contact_request'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_create_contact_request'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_create_contact_request',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if requesteduserid is not None:
            _form_params += parse_form({'requesteduserid': requesteduserid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_data_for_messagearea_search_messages_args(
        self,
        search: Annotated[Optional[StrictStr], Field(description="The string being searched")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is performing the search")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve the template data for searching for messages

        Retrieve the template data for searching for messages

        :param search: The string being searched (required)
        :type search: str
        :param userid: The id of the user who is performing the search (required)
        :type userid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_data_for_messagearea_search_messages_serialize(
            search=search,
            userid=userid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageDataForMessageareaSearchMessagesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_data_for_messagearea_search_messages(
        self,
        search: Annotated[Optional[StrictStr], Field(description="The string being searched")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is performing the search")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageDataForMessageareaSearchMessagesResponse:
        """Retrieve the template data for searching for messages

        Retrieve the template data for searching for messages

        :param search: The string being searched (required)
        :type search: str
        :param userid: The id of the user who is performing the search (required)
        :type userid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_data_for_messagearea_search_messages_serialize(
            search=search,
            userid=userid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageDataForMessageareaSearchMessagesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_data_for_messagearea_search_messages_from_args(
        self,
        args
    ) -> CoreMessageDataForMessageareaSearchMessagesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageDataForMessageareaSearchMessagesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_data_for_messagearea_search_messages_with_http_info(
        self,
        search: Annotated[Optional[StrictStr], Field(description="The string being searched")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is performing the search")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageDataForMessageareaSearchMessagesResponse]:
        """Retrieve the template data for searching for messages

        Retrieve the template data for searching for messages

        :param search: The string being searched (required)
        :type search: str
        :param userid: The id of the user who is performing the search (required)
        :type userid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_data_for_messagearea_search_messages_serialize(
            search=search,
            userid=userid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageDataForMessageareaSearchMessagesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_data_for_messagearea_search_messages_without_preload_content(
        self,
        search: Annotated[Optional[StrictStr], Field(description="The string being searched")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is performing the search")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve the template data for searching for messages

        Retrieve the template data for searching for messages

        :param search: The string being searched (required)
        :type search: str
        :param userid: The id of the user who is performing the search (required)
        :type userid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_data_for_messagearea_search_messages_serialize(
            search=search,
            userid=userid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageDataForMessageareaSearchMessagesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_data_for_messagearea_search_messages_serialize(
        self,
        search,
        userid,
        limitfrom,
        limitnum,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_data_for_messagearea_search_messages'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_data_for_messagearea_search_messages'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_data_for_messagearea_search_messages',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if limitfrom is not None:
            _form_params += parse_form({'limitfrom': limitfrom})
        if limitnum is not None:
            _form_params += parse_form({'limitnum': limitnum})
        if search is not None:
            _form_params += parse_form({'search': search})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_decline_contact_request_args(
        self,
        requesteduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being requested")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user making the request")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Declines a contact request

        Declines a contact request

        :param requesteduserid: The id of the user being requested (required)
        :type requesteduserid: int
        :param userid: The id of the user making the request (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_decline_contact_request_serialize(
            requesteduserid=requesteduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_decline_contact_request(
        self,
        requesteduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being requested")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user making the request")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Declines a contact request

        Declines a contact request

        :param requesteduserid: The id of the user being requested (required)
        :type requesteduserid: int
        :param userid: The id of the user making the request (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_decline_contact_request_serialize(
            requesteduserid=requesteduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_decline_contact_request_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_decline_contact_request_with_http_info(
        self,
        requesteduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being requested")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user making the request")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Declines a contact request

        Declines a contact request

        :param requesteduserid: The id of the user being requested (required)
        :type requesteduserid: int
        :param userid: The id of the user making the request (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_decline_contact_request_serialize(
            requesteduserid=requesteduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_decline_contact_request_without_preload_content(
        self,
        requesteduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being requested")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user making the request")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Declines a contact request

        Declines a contact request

        :param requesteduserid: The id of the user being requested (required)
        :type requesteduserid: int
        :param userid: The id of the user making the request (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_decline_contact_request_serialize(
            requesteduserid=requesteduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_decline_contact_request_serialize(
        self,
        requesteduserid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_decline_contact_request'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_decline_contact_request'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_decline_contact_request',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if requesteduserid is not None:
            _form_params += parse_form({'requesteduserid': requesteduserid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_delete_contacts_args(
        self,
        userids: Annotated[List[Optional[StrictInt]], Field(description="List of user IDs")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user we are deleting the contacts for, 0 for the                     current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Remove contacts from the contact list

        Remove contacts from the contact list

        :param userids: List of user IDs (required)
        :type userids: List[Optional[int]]
        :param userid: The id of the user we are deleting the contacts for, 0 for the                     current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_delete_contacts_serialize(
            userids=userids,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_delete_contacts(
        self,
        userids: Annotated[List[Optional[StrictInt]], Field(description="List of user IDs")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user we are deleting the contacts for, 0 for the                     current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Remove contacts from the contact list

        Remove contacts from the contact list

        :param userids: List of user IDs (required)
        :type userids: List[Optional[int]]
        :param userid: The id of the user we are deleting the contacts for, 0 for the                     current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_delete_contacts_serialize(
            userids=userids,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_delete_contacts_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_delete_contacts_with_http_info(
        self,
        userids: Annotated[List[Optional[StrictInt]], Field(description="List of user IDs")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user we are deleting the contacts for, 0 for the                     current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Remove contacts from the contact list

        Remove contacts from the contact list

        :param userids: List of user IDs (required)
        :type userids: List[Optional[int]]
        :param userid: The id of the user we are deleting the contacts for, 0 for the                     current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_delete_contacts_serialize(
            userids=userids,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_delete_contacts_without_preload_content(
        self,
        userids: Annotated[List[Optional[StrictInt]], Field(description="List of user IDs")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user we are deleting the contacts for, 0 for the                     current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Remove contacts from the contact list

        Remove contacts from the contact list

        :param userids: List of user IDs (required)
        :type userids: List[Optional[int]]
        :param userid: The id of the user we are deleting the contacts for, 0 for the                     current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_delete_contacts_serialize(
            userids=userids,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_delete_contacts_serialize(
        self,
        userids,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'userids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_message_delete_contacts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_delete_contacts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_delete_contacts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        if userids is not None:
            _form_params += parse_form({'userids': userids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_delete_conversations_by_id_args(
        self,
        conversationids: Annotated[List[Optional[StrictInt]], Field(description="List of conversation IDs")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id of who we want to delete the conversation for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes a list of conversations.

        Deletes a list of conversations.

        :param conversationids: List of conversation IDs (required)
        :type conversationids: List[Optional[int]]
        :param userid: The user id of who we want to delete the conversation for (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_delete_conversations_by_id_serialize(
            conversationids=conversationids,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_delete_conversations_by_id(
        self,
        conversationids: Annotated[List[Optional[StrictInt]], Field(description="List of conversation IDs")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id of who we want to delete the conversation for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Deletes a list of conversations.

        Deletes a list of conversations.

        :param conversationids: List of conversation IDs (required)
        :type conversationids: List[Optional[int]]
        :param userid: The user id of who we want to delete the conversation for (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_delete_conversations_by_id_serialize(
            conversationids=conversationids,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_delete_conversations_by_id_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_delete_conversations_by_id_with_http_info(
        self,
        conversationids: Annotated[List[Optional[StrictInt]], Field(description="List of conversation IDs")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id of who we want to delete the conversation for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Deletes a list of conversations.

        Deletes a list of conversations.

        :param conversationids: List of conversation IDs (required)
        :type conversationids: List[Optional[int]]
        :param userid: The user id of who we want to delete the conversation for (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_delete_conversations_by_id_serialize(
            conversationids=conversationids,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_delete_conversations_by_id_without_preload_content(
        self,
        conversationids: Annotated[List[Optional[StrictInt]], Field(description="List of conversation IDs")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id of who we want to delete the conversation for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes a list of conversations.

        Deletes a list of conversations.

        :param conversationids: List of conversation IDs (required)
        :type conversationids: List[Optional[int]]
        :param userid: The user id of who we want to delete the conversation for (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_delete_conversations_by_id_serialize(
            conversationids=conversationids,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_delete_conversations_by_id_serialize(
        self,
        conversationids,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'conversationids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_message_delete_conversations_by_id'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_delete_conversations_by_id'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_delete_conversations_by_id',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if conversationids is not None:
            _form_params += parse_form({'conversationids': conversationids})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_delete_message_args(
        self,
        messageid: Annotated[Optional[StrictInt], Field(description="The message id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id of who we want to delete the message for")],
        read: Annotated[Optional[StrictBool], Field(description="If is a message read")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes a message.

        Deletes a message.

        :param messageid: The message id (required)
        :type messageid: int
        :param userid: The user id of who we want to delete the message for (required)
        :type userid: int
        :param read: If is a message read
        :type read: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_delete_message_serialize(
            messageid=messageid,
            userid=userid,
            read=read,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageDeleteMessageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_delete_message(
        self,
        messageid: Annotated[Optional[StrictInt], Field(description="The message id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id of who we want to delete the message for")],
        read: Annotated[Optional[StrictBool], Field(description="If is a message read")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageDeleteMessageResponse:
        """Deletes a message.

        Deletes a message.

        :param messageid: The message id (required)
        :type messageid: int
        :param userid: The user id of who we want to delete the message for (required)
        :type userid: int
        :param read: If is a message read
        :type read: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_delete_message_serialize(
            messageid=messageid,
            userid=userid,
            read=read,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageDeleteMessageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_delete_message_from_args(
        self,
        args
    ) -> CoreMessageDeleteMessageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageDeleteMessageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_delete_message_with_http_info(
        self,
        messageid: Annotated[Optional[StrictInt], Field(description="The message id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id of who we want to delete the message for")],
        read: Annotated[Optional[StrictBool], Field(description="If is a message read")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageDeleteMessageResponse]:
        """Deletes a message.

        Deletes a message.

        :param messageid: The message id (required)
        :type messageid: int
        :param userid: The user id of who we want to delete the message for (required)
        :type userid: int
        :param read: If is a message read
        :type read: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_delete_message_serialize(
            messageid=messageid,
            userid=userid,
            read=read,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageDeleteMessageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_delete_message_without_preload_content(
        self,
        messageid: Annotated[Optional[StrictInt], Field(description="The message id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id of who we want to delete the message for")],
        read: Annotated[Optional[StrictBool], Field(description="If is a message read")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes a message.

        Deletes a message.

        :param messageid: The message id (required)
        :type messageid: int
        :param userid: The user id of who we want to delete the message for (required)
        :type userid: int
        :param read: If is a message read
        :type read: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_delete_message_serialize(
            messageid=messageid,
            userid=userid,
            read=read,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageDeleteMessageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_delete_message_serialize(
        self,
        messageid,
        userid,
        read,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_delete_message'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_delete_message'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_delete_message',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if messageid is not None:
            _form_params += parse_form({'messageid': messageid})
        if read is not None:
            _form_params += parse_form({'read': read})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_delete_message_for_all_users_args(
        self,
        messageid: Annotated[Optional[StrictInt], Field(description="The message id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id of who we want to delete the message for all users")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes a message for all users.

        Deletes a message for all users.

        :param messageid: The message id (required)
        :type messageid: int
        :param userid: The user id of who we want to delete the message for all users (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_delete_message_for_all_users_serialize(
            messageid=messageid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_delete_message_for_all_users(
        self,
        messageid: Annotated[Optional[StrictInt], Field(description="The message id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id of who we want to delete the message for all users")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Deletes a message for all users.

        Deletes a message for all users.

        :param messageid: The message id (required)
        :type messageid: int
        :param userid: The user id of who we want to delete the message for all users (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_delete_message_for_all_users_serialize(
            messageid=messageid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_delete_message_for_all_users_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_delete_message_for_all_users_with_http_info(
        self,
        messageid: Annotated[Optional[StrictInt], Field(description="The message id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id of who we want to delete the message for all users")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Deletes a message for all users.

        Deletes a message for all users.

        :param messageid: The message id (required)
        :type messageid: int
        :param userid: The user id of who we want to delete the message for all users (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_delete_message_for_all_users_serialize(
            messageid=messageid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_delete_message_for_all_users_without_preload_content(
        self,
        messageid: Annotated[Optional[StrictInt], Field(description="The message id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id of who we want to delete the message for all users")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes a message for all users.

        Deletes a message for all users.

        :param messageid: The message id (required)
        :type messageid: int
        :param userid: The user id of who we want to delete the message for all users (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_delete_message_for_all_users_serialize(
            messageid=messageid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_delete_message_for_all_users_serialize(
        self,
        messageid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_delete_message_for_all_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_delete_message_for_all_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_delete_message_for_all_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if messageid is not None:
            _form_params += parse_form({'messageid': messageid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_blocked_users_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="the user whose blocked users we want to retrieve")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve a list of users blocked

        Retrieve a list of users blocked

        :param userid: the user whose blocked users we want to retrieve (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_blocked_users_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetBlockedUsersResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_blocked_users(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="the user whose blocked users we want to retrieve")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageGetBlockedUsersResponse:
        """Retrieve a list of users blocked

        Retrieve a list of users blocked

        :param userid: the user whose blocked users we want to retrieve (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_blocked_users_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetBlockedUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_blocked_users_from_args(
        self,
        args
    ) -> CoreMessageGetBlockedUsersResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetBlockedUsersResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_blocked_users_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="the user whose blocked users we want to retrieve")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageGetBlockedUsersResponse]:
        """Retrieve a list of users blocked

        Retrieve a list of users blocked

        :param userid: the user whose blocked users we want to retrieve (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_blocked_users_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetBlockedUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_blocked_users_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="the user whose blocked users we want to retrieve")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve a list of users blocked

        Retrieve a list of users blocked

        :param userid: the user whose blocked users we want to retrieve (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_blocked_users_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetBlockedUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_blocked_users_serialize(
        self,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_blocked_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_blocked_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_blocked_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_contact_requests_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user we want the requests for")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns contact requests for a user

        Returns contact requests for a user

        :param userid: The id of the user we want the requests for (required)
        :type userid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_contact_requests_serialize(
            userid=userid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_contact_requests(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user we want the requests for")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreMessageGetContactRequestsResponseInner]:
        """Returns contact requests for a user

        Returns contact requests for a user

        :param userid: The id of the user we want the requests for (required)
        :type userid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_contact_requests_serialize(
            userid=userid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_contact_requests_from_args(
        self,
        args
    ) -> List[CoreMessageGetContactRequestsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_contact_requests_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user we want the requests for")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreMessageGetContactRequestsResponseInner]]:
        """Returns contact requests for a user

        Returns contact requests for a user

        :param userid: The id of the user we want the requests for (required)
        :type userid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_contact_requests_serialize(
            userid=userid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_contact_requests_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user we want the requests for")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns contact requests for a user

        Returns contact requests for a user

        :param userid: The id of the user we want the requests for (required)
        :type userid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_contact_requests_serialize(
            userid=userid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_contact_requests_serialize(
        self,
        userid,
        limitfrom,
        limitnum,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_contact_requests'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_contact_requests'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_contact_requests',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if limitfrom is not None:
            _form_params += parse_form({'limitfrom': limitfrom})
        if limitnum is not None:
            _form_params += parse_form({'limitnum': limitnum})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_conversation_args(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="The id of the conversation to fetch")],
        includecontactrequests: Annotated[Optional[StrictBool], Field(description="Include contact requests in the members")],
        includeprivacyinfo: Annotated[Optional[StrictBool], Field(description="Include privacy info in the members")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we are viewing conversations for")],
        memberlimit: Annotated[Optional[StrictInt], Field(description="Limit for number of members")] = None,
        memberoffset: Annotated[Optional[StrictInt], Field(description="Offset for member list")] = None,
        messagelimit: Annotated[Optional[StrictInt], Field(description="Limit for number of messages")] = None,
        messageoffset: Annotated[Optional[StrictInt], Field(description="Offset for messages list")] = None,
        newestmessagesfirst: Annotated[Optional[StrictBool], Field(description="Order messages by newest first")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve a conversation for a user

        Retrieve a conversation for a user

        :param conversationid: The id of the conversation to fetch (required)
        :type conversationid: int
        :param includecontactrequests: Include contact requests in the members (required)
        :type includecontactrequests: bool
        :param includeprivacyinfo: Include privacy info in the members (required)
        :type includeprivacyinfo: bool
        :param userid: The id of the user who we are viewing conversations for (required)
        :type userid: int
        :param memberlimit: Limit for number of members
        :type memberlimit: int
        :param memberoffset: Offset for member list
        :type memberoffset: int
        :param messagelimit: Limit for number of messages
        :type messagelimit: int
        :param messageoffset: Offset for messages list
        :type messageoffset: int
        :param newestmessagesfirst: Order messages by newest first
        :type newestmessagesfirst: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_serialize(
            conversationid=conversationid,
            includecontactrequests=includecontactrequests,
            includeprivacyinfo=includeprivacyinfo,
            userid=userid,
            memberlimit=memberlimit,
            memberoffset=memberoffset,
            messagelimit=messagelimit,
            messageoffset=messageoffset,
            newestmessagesfirst=newestmessagesfirst,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_conversation(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="The id of the conversation to fetch")],
        includecontactrequests: Annotated[Optional[StrictBool], Field(description="Include contact requests in the members")],
        includeprivacyinfo: Annotated[Optional[StrictBool], Field(description="Include privacy info in the members")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we are viewing conversations for")],
        memberlimit: Annotated[Optional[StrictInt], Field(description="Limit for number of members")] = None,
        memberoffset: Annotated[Optional[StrictInt], Field(description="Offset for member list")] = None,
        messagelimit: Annotated[Optional[StrictInt], Field(description="Limit for number of messages")] = None,
        messageoffset: Annotated[Optional[StrictInt], Field(description="Offset for messages list")] = None,
        newestmessagesfirst: Annotated[Optional[StrictBool], Field(description="Order messages by newest first")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageGetConversationResponse:
        """Retrieve a conversation for a user

        Retrieve a conversation for a user

        :param conversationid: The id of the conversation to fetch (required)
        :type conversationid: int
        :param includecontactrequests: Include contact requests in the members (required)
        :type includecontactrequests: bool
        :param includeprivacyinfo: Include privacy info in the members (required)
        :type includeprivacyinfo: bool
        :param userid: The id of the user who we are viewing conversations for (required)
        :type userid: int
        :param memberlimit: Limit for number of members
        :type memberlimit: int
        :param memberoffset: Offset for member list
        :type memberoffset: int
        :param messagelimit: Limit for number of messages
        :type messagelimit: int
        :param messageoffset: Offset for messages list
        :type messageoffset: int
        :param newestmessagesfirst: Order messages by newest first
        :type newestmessagesfirst: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_serialize(
            conversationid=conversationid,
            includecontactrequests=includecontactrequests,
            includeprivacyinfo=includeprivacyinfo,
            userid=userid,
            memberlimit=memberlimit,
            memberoffset=memberoffset,
            messagelimit=messagelimit,
            messageoffset=messageoffset,
            newestmessagesfirst=newestmessagesfirst,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_conversation_from_args(
        self,
        args
    ) -> CoreMessageGetConversationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_conversation_with_http_info(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="The id of the conversation to fetch")],
        includecontactrequests: Annotated[Optional[StrictBool], Field(description="Include contact requests in the members")],
        includeprivacyinfo: Annotated[Optional[StrictBool], Field(description="Include privacy info in the members")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we are viewing conversations for")],
        memberlimit: Annotated[Optional[StrictInt], Field(description="Limit for number of members")] = None,
        memberoffset: Annotated[Optional[StrictInt], Field(description="Offset for member list")] = None,
        messagelimit: Annotated[Optional[StrictInt], Field(description="Limit for number of messages")] = None,
        messageoffset: Annotated[Optional[StrictInt], Field(description="Offset for messages list")] = None,
        newestmessagesfirst: Annotated[Optional[StrictBool], Field(description="Order messages by newest first")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageGetConversationResponse]:
        """Retrieve a conversation for a user

        Retrieve a conversation for a user

        :param conversationid: The id of the conversation to fetch (required)
        :type conversationid: int
        :param includecontactrequests: Include contact requests in the members (required)
        :type includecontactrequests: bool
        :param includeprivacyinfo: Include privacy info in the members (required)
        :type includeprivacyinfo: bool
        :param userid: The id of the user who we are viewing conversations for (required)
        :type userid: int
        :param memberlimit: Limit for number of members
        :type memberlimit: int
        :param memberoffset: Offset for member list
        :type memberoffset: int
        :param messagelimit: Limit for number of messages
        :type messagelimit: int
        :param messageoffset: Offset for messages list
        :type messageoffset: int
        :param newestmessagesfirst: Order messages by newest first
        :type newestmessagesfirst: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_serialize(
            conversationid=conversationid,
            includecontactrequests=includecontactrequests,
            includeprivacyinfo=includeprivacyinfo,
            userid=userid,
            memberlimit=memberlimit,
            memberoffset=memberoffset,
            messagelimit=messagelimit,
            messageoffset=messageoffset,
            newestmessagesfirst=newestmessagesfirst,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_conversation_without_preload_content(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="The id of the conversation to fetch")],
        includecontactrequests: Annotated[Optional[StrictBool], Field(description="Include contact requests in the members")],
        includeprivacyinfo: Annotated[Optional[StrictBool], Field(description="Include privacy info in the members")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we are viewing conversations for")],
        memberlimit: Annotated[Optional[StrictInt], Field(description="Limit for number of members")] = None,
        memberoffset: Annotated[Optional[StrictInt], Field(description="Offset for member list")] = None,
        messagelimit: Annotated[Optional[StrictInt], Field(description="Limit for number of messages")] = None,
        messageoffset: Annotated[Optional[StrictInt], Field(description="Offset for messages list")] = None,
        newestmessagesfirst: Annotated[Optional[StrictBool], Field(description="Order messages by newest first")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve a conversation for a user

        Retrieve a conversation for a user

        :param conversationid: The id of the conversation to fetch (required)
        :type conversationid: int
        :param includecontactrequests: Include contact requests in the members (required)
        :type includecontactrequests: bool
        :param includeprivacyinfo: Include privacy info in the members (required)
        :type includeprivacyinfo: bool
        :param userid: The id of the user who we are viewing conversations for (required)
        :type userid: int
        :param memberlimit: Limit for number of members
        :type memberlimit: int
        :param memberoffset: Offset for member list
        :type memberoffset: int
        :param messagelimit: Limit for number of messages
        :type messagelimit: int
        :param messageoffset: Offset for messages list
        :type messageoffset: int
        :param newestmessagesfirst: Order messages by newest first
        :type newestmessagesfirst: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_serialize(
            conversationid=conversationid,
            includecontactrequests=includecontactrequests,
            includeprivacyinfo=includeprivacyinfo,
            userid=userid,
            memberlimit=memberlimit,
            memberoffset=memberoffset,
            messagelimit=messagelimit,
            messageoffset=messageoffset,
            newestmessagesfirst=newestmessagesfirst,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_conversation_serialize(
        self,
        conversationid,
        includecontactrequests,
        includeprivacyinfo,
        userid,
        memberlimit,
        memberoffset,
        messagelimit,
        messageoffset,
        newestmessagesfirst,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_conversation'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_conversation'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_conversation',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if conversationid is not None:
            _form_params += parse_form({'conversationid': conversationid})
        if includecontactrequests is not None:
            _form_params += parse_form({'includecontactrequests': includecontactrequests})
        if includeprivacyinfo is not None:
            _form_params += parse_form({'includeprivacyinfo': includeprivacyinfo})
        if memberlimit is not None:
            _form_params += parse_form({'memberlimit': memberlimit})
        if memberoffset is not None:
            _form_params += parse_form({'memberoffset': memberoffset})
        if messagelimit is not None:
            _form_params += parse_form({'messagelimit': messagelimit})
        if messageoffset is not None:
            _form_params += parse_form({'messageoffset': messageoffset})
        if newestmessagesfirst is not None:
            _form_params += parse_form({'newestmessagesfirst': newestmessagesfirst})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_conversation_between_users_args(
        self,
        includecontactrequests: Annotated[Optional[StrictBool], Field(description="Include contact requests in the members")],
        includeprivacyinfo: Annotated[Optional[StrictBool], Field(description="Include privacy info in the members")],
        otheruserid: Annotated[Optional[StrictInt], Field(description="The other user id")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we are viewing conversations for")],
        memberlimit: Annotated[Optional[StrictInt], Field(description="Limit for number of members")] = None,
        memberoffset: Annotated[Optional[StrictInt], Field(description="Offset for member list")] = None,
        messagelimit: Annotated[Optional[StrictInt], Field(description="Limit for number of messages")] = None,
        messageoffset: Annotated[Optional[StrictInt], Field(description="Offset for messages list")] = None,
        newestmessagesfirst: Annotated[Optional[StrictBool], Field(description="Order messages by newest first")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve a conversation for a user between another user

        Retrieve a conversation for a user between another user

        :param includecontactrequests: Include contact requests in the members (required)
        :type includecontactrequests: bool
        :param includeprivacyinfo: Include privacy info in the members (required)
        :type includeprivacyinfo: bool
        :param otheruserid: The other user id (required)
        :type otheruserid: int
        :param userid: The id of the user who we are viewing conversations for (required)
        :type userid: int
        :param memberlimit: Limit for number of members
        :type memberlimit: int
        :param memberoffset: Offset for member list
        :type memberoffset: int
        :param messagelimit: Limit for number of messages
        :type messagelimit: int
        :param messageoffset: Offset for messages list
        :type messageoffset: int
        :param newestmessagesfirst: Order messages by newest first
        :type newestmessagesfirst: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_between_users_serialize(
            includecontactrequests=includecontactrequests,
            includeprivacyinfo=includeprivacyinfo,
            otheruserid=otheruserid,
            userid=userid,
            memberlimit=memberlimit,
            memberoffset=memberoffset,
            messagelimit=messagelimit,
            messageoffset=messageoffset,
            newestmessagesfirst=newestmessagesfirst,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationBetweenUsersResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_conversation_between_users(
        self,
        includecontactrequests: Annotated[Optional[StrictBool], Field(description="Include contact requests in the members")],
        includeprivacyinfo: Annotated[Optional[StrictBool], Field(description="Include privacy info in the members")],
        otheruserid: Annotated[Optional[StrictInt], Field(description="The other user id")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we are viewing conversations for")],
        memberlimit: Annotated[Optional[StrictInt], Field(description="Limit for number of members")] = None,
        memberoffset: Annotated[Optional[StrictInt], Field(description="Offset for member list")] = None,
        messagelimit: Annotated[Optional[StrictInt], Field(description="Limit for number of messages")] = None,
        messageoffset: Annotated[Optional[StrictInt], Field(description="Offset for messages list")] = None,
        newestmessagesfirst: Annotated[Optional[StrictBool], Field(description="Order messages by newest first")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageGetConversationBetweenUsersResponse:
        """Retrieve a conversation for a user between another user

        Retrieve a conversation for a user between another user

        :param includecontactrequests: Include contact requests in the members (required)
        :type includecontactrequests: bool
        :param includeprivacyinfo: Include privacy info in the members (required)
        :type includeprivacyinfo: bool
        :param otheruserid: The other user id (required)
        :type otheruserid: int
        :param userid: The id of the user who we are viewing conversations for (required)
        :type userid: int
        :param memberlimit: Limit for number of members
        :type memberlimit: int
        :param memberoffset: Offset for member list
        :type memberoffset: int
        :param messagelimit: Limit for number of messages
        :type messagelimit: int
        :param messageoffset: Offset for messages list
        :type messageoffset: int
        :param newestmessagesfirst: Order messages by newest first
        :type newestmessagesfirst: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_between_users_serialize(
            includecontactrequests=includecontactrequests,
            includeprivacyinfo=includeprivacyinfo,
            otheruserid=otheruserid,
            userid=userid,
            memberlimit=memberlimit,
            memberoffset=memberoffset,
            messagelimit=messagelimit,
            messageoffset=messageoffset,
            newestmessagesfirst=newestmessagesfirst,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationBetweenUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_conversation_between_users_from_args(
        self,
        args
    ) -> CoreMessageGetConversationBetweenUsersResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationBetweenUsersResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_conversation_between_users_with_http_info(
        self,
        includecontactrequests: Annotated[Optional[StrictBool], Field(description="Include contact requests in the members")],
        includeprivacyinfo: Annotated[Optional[StrictBool], Field(description="Include privacy info in the members")],
        otheruserid: Annotated[Optional[StrictInt], Field(description="The other user id")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we are viewing conversations for")],
        memberlimit: Annotated[Optional[StrictInt], Field(description="Limit for number of members")] = None,
        memberoffset: Annotated[Optional[StrictInt], Field(description="Offset for member list")] = None,
        messagelimit: Annotated[Optional[StrictInt], Field(description="Limit for number of messages")] = None,
        messageoffset: Annotated[Optional[StrictInt], Field(description="Offset for messages list")] = None,
        newestmessagesfirst: Annotated[Optional[StrictBool], Field(description="Order messages by newest first")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageGetConversationBetweenUsersResponse]:
        """Retrieve a conversation for a user between another user

        Retrieve a conversation for a user between another user

        :param includecontactrequests: Include contact requests in the members (required)
        :type includecontactrequests: bool
        :param includeprivacyinfo: Include privacy info in the members (required)
        :type includeprivacyinfo: bool
        :param otheruserid: The other user id (required)
        :type otheruserid: int
        :param userid: The id of the user who we are viewing conversations for (required)
        :type userid: int
        :param memberlimit: Limit for number of members
        :type memberlimit: int
        :param memberoffset: Offset for member list
        :type memberoffset: int
        :param messagelimit: Limit for number of messages
        :type messagelimit: int
        :param messageoffset: Offset for messages list
        :type messageoffset: int
        :param newestmessagesfirst: Order messages by newest first
        :type newestmessagesfirst: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_between_users_serialize(
            includecontactrequests=includecontactrequests,
            includeprivacyinfo=includeprivacyinfo,
            otheruserid=otheruserid,
            userid=userid,
            memberlimit=memberlimit,
            memberoffset=memberoffset,
            messagelimit=messagelimit,
            messageoffset=messageoffset,
            newestmessagesfirst=newestmessagesfirst,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationBetweenUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_conversation_between_users_without_preload_content(
        self,
        includecontactrequests: Annotated[Optional[StrictBool], Field(description="Include contact requests in the members")],
        includeprivacyinfo: Annotated[Optional[StrictBool], Field(description="Include privacy info in the members")],
        otheruserid: Annotated[Optional[StrictInt], Field(description="The other user id")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we are viewing conversations for")],
        memberlimit: Annotated[Optional[StrictInt], Field(description="Limit for number of members")] = None,
        memberoffset: Annotated[Optional[StrictInt], Field(description="Offset for member list")] = None,
        messagelimit: Annotated[Optional[StrictInt], Field(description="Limit for number of messages")] = None,
        messageoffset: Annotated[Optional[StrictInt], Field(description="Offset for messages list")] = None,
        newestmessagesfirst: Annotated[Optional[StrictBool], Field(description="Order messages by newest first")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve a conversation for a user between another user

        Retrieve a conversation for a user between another user

        :param includecontactrequests: Include contact requests in the members (required)
        :type includecontactrequests: bool
        :param includeprivacyinfo: Include privacy info in the members (required)
        :type includeprivacyinfo: bool
        :param otheruserid: The other user id (required)
        :type otheruserid: int
        :param userid: The id of the user who we are viewing conversations for (required)
        :type userid: int
        :param memberlimit: Limit for number of members
        :type memberlimit: int
        :param memberoffset: Offset for member list
        :type memberoffset: int
        :param messagelimit: Limit for number of messages
        :type messagelimit: int
        :param messageoffset: Offset for messages list
        :type messageoffset: int
        :param newestmessagesfirst: Order messages by newest first
        :type newestmessagesfirst: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_between_users_serialize(
            includecontactrequests=includecontactrequests,
            includeprivacyinfo=includeprivacyinfo,
            otheruserid=otheruserid,
            userid=userid,
            memberlimit=memberlimit,
            memberoffset=memberoffset,
            messagelimit=messagelimit,
            messageoffset=messageoffset,
            newestmessagesfirst=newestmessagesfirst,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationBetweenUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_conversation_between_users_serialize(
        self,
        includecontactrequests,
        includeprivacyinfo,
        otheruserid,
        userid,
        memberlimit,
        memberoffset,
        messagelimit,
        messageoffset,
        newestmessagesfirst,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_conversation_between_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_conversation_between_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_conversation_between_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if includecontactrequests is not None:
            _form_params += parse_form({'includecontactrequests': includecontactrequests})
        if includeprivacyinfo is not None:
            _form_params += parse_form({'includeprivacyinfo': includeprivacyinfo})
        if memberlimit is not None:
            _form_params += parse_form({'memberlimit': memberlimit})
        if memberoffset is not None:
            _form_params += parse_form({'memberoffset': memberoffset})
        if messagelimit is not None:
            _form_params += parse_form({'messagelimit': messagelimit})
        if messageoffset is not None:
            _form_params += parse_form({'messageoffset': messageoffset})
        if newestmessagesfirst is not None:
            _form_params += parse_form({'newestmessagesfirst': newestmessagesfirst})
        if otheruserid is not None:
            _form_params += parse_form({'otheruserid': otheruserid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_conversation_counts_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve a list of conversation counts, indexed by type.

        Retrieve a list of conversation counts, indexed by type.

        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_counts_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationCountsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_conversation_counts(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageGetConversationCountsResponse:
        """Retrieve a list of conversation counts, indexed by type.

        Retrieve a list of conversation counts, indexed by type.

        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_counts_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationCountsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_conversation_counts_from_args(
        self,
        args
    ) -> CoreMessageGetConversationCountsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationCountsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_conversation_counts_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageGetConversationCountsResponse]:
        """Retrieve a list of conversation counts, indexed by type.

        Retrieve a list of conversation counts, indexed by type.

        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_counts_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationCountsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_conversation_counts_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve a list of conversation counts, indexed by type.

        Retrieve a list of conversation counts, indexed by type.

        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_counts_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationCountsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_conversation_counts_serialize(
        self,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_conversation_counts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_conversation_counts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_conversation_counts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_conversation_members_args(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="The id of the conversation")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user we are performing this action on behalf of")],
        includecontactrequests: Annotated[Optional[StrictBool], Field(description="Do we want to include contact requests?")] = None,
        includeprivacyinfo: Annotated[Optional[StrictBool], Field(description="Do we want to include privacy info?")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve a list of members in a conversation

        Retrieve a list of members in a conversation

        :param conversationid: The id of the conversation (required)
        :type conversationid: int
        :param userid: The id of the user we are performing this action on behalf of (required)
        :type userid: int
        :param includecontactrequests: Do we want to include contact requests?
        :type includecontactrequests: bool
        :param includeprivacyinfo: Do we want to include privacy info?
        :type includeprivacyinfo: bool
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_members_serialize(
            conversationid=conversationid,
            userid=userid,
            includecontactrequests=includecontactrequests,
            includeprivacyinfo=includeprivacyinfo,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_conversation_members(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="The id of the conversation")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user we are performing this action on behalf of")],
        includecontactrequests: Annotated[Optional[StrictBool], Field(description="Do we want to include contact requests?")] = None,
        includeprivacyinfo: Annotated[Optional[StrictBool], Field(description="Do we want to include privacy info?")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreMessageGetContactRequestsResponseInner]:
        """Retrieve a list of members in a conversation

        Retrieve a list of members in a conversation

        :param conversationid: The id of the conversation (required)
        :type conversationid: int
        :param userid: The id of the user we are performing this action on behalf of (required)
        :type userid: int
        :param includecontactrequests: Do we want to include contact requests?
        :type includecontactrequests: bool
        :param includeprivacyinfo: Do we want to include privacy info?
        :type includeprivacyinfo: bool
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_members_serialize(
            conversationid=conversationid,
            userid=userid,
            includecontactrequests=includecontactrequests,
            includeprivacyinfo=includeprivacyinfo,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_conversation_members_from_args(
        self,
        args
    ) -> List[CoreMessageGetContactRequestsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_conversation_members_with_http_info(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="The id of the conversation")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user we are performing this action on behalf of")],
        includecontactrequests: Annotated[Optional[StrictBool], Field(description="Do we want to include contact requests?")] = None,
        includeprivacyinfo: Annotated[Optional[StrictBool], Field(description="Do we want to include privacy info?")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreMessageGetContactRequestsResponseInner]]:
        """Retrieve a list of members in a conversation

        Retrieve a list of members in a conversation

        :param conversationid: The id of the conversation (required)
        :type conversationid: int
        :param userid: The id of the user we are performing this action on behalf of (required)
        :type userid: int
        :param includecontactrequests: Do we want to include contact requests?
        :type includecontactrequests: bool
        :param includeprivacyinfo: Do we want to include privacy info?
        :type includeprivacyinfo: bool
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_members_serialize(
            conversationid=conversationid,
            userid=userid,
            includecontactrequests=includecontactrequests,
            includeprivacyinfo=includeprivacyinfo,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_conversation_members_without_preload_content(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="The id of the conversation")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user we are performing this action on behalf of")],
        includecontactrequests: Annotated[Optional[StrictBool], Field(description="Do we want to include contact requests?")] = None,
        includeprivacyinfo: Annotated[Optional[StrictBool], Field(description="Do we want to include privacy info?")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve a list of members in a conversation

        Retrieve a list of members in a conversation

        :param conversationid: The id of the conversation (required)
        :type conversationid: int
        :param userid: The id of the user we are performing this action on behalf of (required)
        :type userid: int
        :param includecontactrequests: Do we want to include contact requests?
        :type includecontactrequests: bool
        :param includeprivacyinfo: Do we want to include privacy info?
        :type includeprivacyinfo: bool
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_members_serialize(
            conversationid=conversationid,
            userid=userid,
            includecontactrequests=includecontactrequests,
            includeprivacyinfo=includeprivacyinfo,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_conversation_members_serialize(
        self,
        conversationid,
        userid,
        includecontactrequests,
        includeprivacyinfo,
        limitfrom,
        limitnum,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_conversation_members'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_conversation_members'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_conversation_members',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if conversationid is not None:
            _form_params += parse_form({'conversationid': conversationid})
        if includecontactrequests is not None:
            _form_params += parse_form({'includecontactrequests': includecontactrequests})
        if includeprivacyinfo is not None:
            _form_params += parse_form({'includeprivacyinfo': includeprivacyinfo})
        if limitfrom is not None:
            _form_params += parse_form({'limitfrom': limitfrom})
        if limitnum is not None:
            _form_params += parse_form({'limitnum': limitnum})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_conversation_messages_args(
        self,
        convid: Annotated[Optional[StrictInt], Field(description="The conversation id")],
        currentuserid: Annotated[Optional[StrictInt], Field(description="The current user's id")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        newest: Annotated[Optional[StrictBool], Field(description="Newest first?")] = None,
        timefrom: Annotated[Optional[StrictInt], Field(description="The timestamp from which the messages were created")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve the conversation messages and relevant member information

        Retrieve the conversation messages and relevant member information

        :param convid: The conversation id (required)
        :type convid: int
        :param currentuserid: The current user's id (required)
        :type currentuserid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param newest: Newest first?
        :type newest: bool
        :param timefrom: The timestamp from which the messages were created
        :type timefrom: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_messages_serialize(
            convid=convid,
            currentuserid=currentuserid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            newest=newest,
            timefrom=timefrom,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationMessagesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_conversation_messages(
        self,
        convid: Annotated[Optional[StrictInt], Field(description="The conversation id")],
        currentuserid: Annotated[Optional[StrictInt], Field(description="The current user's id")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        newest: Annotated[Optional[StrictBool], Field(description="Newest first?")] = None,
        timefrom: Annotated[Optional[StrictInt], Field(description="The timestamp from which the messages were created")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageGetConversationMessagesResponse:
        """Retrieve the conversation messages and relevant member information

        Retrieve the conversation messages and relevant member information

        :param convid: The conversation id (required)
        :type convid: int
        :param currentuserid: The current user's id (required)
        :type currentuserid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param newest: Newest first?
        :type newest: bool
        :param timefrom: The timestamp from which the messages were created
        :type timefrom: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_messages_serialize(
            convid=convid,
            currentuserid=currentuserid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            newest=newest,
            timefrom=timefrom,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationMessagesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_conversation_messages_from_args(
        self,
        args
    ) -> CoreMessageGetConversationMessagesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationMessagesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_conversation_messages_with_http_info(
        self,
        convid: Annotated[Optional[StrictInt], Field(description="The conversation id")],
        currentuserid: Annotated[Optional[StrictInt], Field(description="The current user's id")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        newest: Annotated[Optional[StrictBool], Field(description="Newest first?")] = None,
        timefrom: Annotated[Optional[StrictInt], Field(description="The timestamp from which the messages were created")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageGetConversationMessagesResponse]:
        """Retrieve the conversation messages and relevant member information

        Retrieve the conversation messages and relevant member information

        :param convid: The conversation id (required)
        :type convid: int
        :param currentuserid: The current user's id (required)
        :type currentuserid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param newest: Newest first?
        :type newest: bool
        :param timefrom: The timestamp from which the messages were created
        :type timefrom: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_messages_serialize(
            convid=convid,
            currentuserid=currentuserid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            newest=newest,
            timefrom=timefrom,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationMessagesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_conversation_messages_without_preload_content(
        self,
        convid: Annotated[Optional[StrictInt], Field(description="The conversation id")],
        currentuserid: Annotated[Optional[StrictInt], Field(description="The current user's id")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        newest: Annotated[Optional[StrictBool], Field(description="Newest first?")] = None,
        timefrom: Annotated[Optional[StrictInt], Field(description="The timestamp from which the messages were created")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve the conversation messages and relevant member information

        Retrieve the conversation messages and relevant member information

        :param convid: The conversation id (required)
        :type convid: int
        :param currentuserid: The current user's id (required)
        :type currentuserid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param newest: Newest first?
        :type newest: bool
        :param timefrom: The timestamp from which the messages were created
        :type timefrom: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversation_messages_serialize(
            convid=convid,
            currentuserid=currentuserid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            newest=newest,
            timefrom=timefrom,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationMessagesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_conversation_messages_serialize(
        self,
        convid,
        currentuserid,
        limitfrom,
        limitnum,
        newest,
        timefrom,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_conversation_messages'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_conversation_messages'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_conversation_messages',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if convid is not None:
            _form_params += parse_form({'convid': convid})
        if currentuserid is not None:
            _form_params += parse_form({'currentuserid': currentuserid})
        if limitfrom is not None:
            _form_params += parse_form({'limitfrom': limitfrom})
        if limitnum is not None:
            _form_params += parse_form({'limitnum': limitnum})
        if newest is not None:
            _form_params += parse_form({'newest': newest})
        if timefrom is not None:
            _form_params += parse_form({'timefrom': timefrom})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_conversations_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we are viewing conversations for")],
        favourites: Annotated[Optional[StrictBool], Field(description="Whether to restrict the results to contain NO favourite                 conversations (false), ONLY favourite conversation (true), or ignore any restriction altogether (null)")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="The offset to start at")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number of conversations to this")] = None,
        mergeself: Annotated[Optional[StrictBool], Field(description="Whether to include self-conversations (true) or ONLY private                     conversations (false) when private conversations are requested.")] = None,
        type: Annotated[Optional[StrictInt], Field(description="Filter by type")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve a list of conversations for a user

        Retrieve a list of conversations for a user

        :param userid: The id of the user who we are viewing conversations for (required)
        :type userid: int
        :param favourites: Whether to restrict the results to contain NO favourite                 conversations (false), ONLY favourite conversation (true), or ignore any restriction altogether (null)
        :type favourites: bool
        :param limitfrom: The offset to start at
        :type limitfrom: int
        :param limitnum: Limit number of conversations to this
        :type limitnum: int
        :param mergeself: Whether to include self-conversations (true) or ONLY private                     conversations (false) when private conversations are requested.
        :type mergeself: bool
        :param type: Filter by type
        :type type: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversations_serialize(
            userid=userid,
            favourites=favourites,
            limitfrom=limitfrom,
            limitnum=limitnum,
            mergeself=mergeself,
            type=type,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_conversations(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we are viewing conversations for")],
        favourites: Annotated[Optional[StrictBool], Field(description="Whether to restrict the results to contain NO favourite                 conversations (false), ONLY favourite conversation (true), or ignore any restriction altogether (null)")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="The offset to start at")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number of conversations to this")] = None,
        mergeself: Annotated[Optional[StrictBool], Field(description="Whether to include self-conversations (true) or ONLY private                     conversations (false) when private conversations are requested.")] = None,
        type: Annotated[Optional[StrictInt], Field(description="Filter by type")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageGetConversationsResponse:
        """Retrieve a list of conversations for a user

        Retrieve a list of conversations for a user

        :param userid: The id of the user who we are viewing conversations for (required)
        :type userid: int
        :param favourites: Whether to restrict the results to contain NO favourite                 conversations (false), ONLY favourite conversation (true), or ignore any restriction altogether (null)
        :type favourites: bool
        :param limitfrom: The offset to start at
        :type limitfrom: int
        :param limitnum: Limit number of conversations to this
        :type limitnum: int
        :param mergeself: Whether to include self-conversations (true) or ONLY private                     conversations (false) when private conversations are requested.
        :type mergeself: bool
        :param type: Filter by type
        :type type: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversations_serialize(
            userid=userid,
            favourites=favourites,
            limitfrom=limitfrom,
            limitnum=limitnum,
            mergeself=mergeself,
            type=type,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_conversations_from_args(
        self,
        args
    ) -> CoreMessageGetConversationsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_conversations_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we are viewing conversations for")],
        favourites: Annotated[Optional[StrictBool], Field(description="Whether to restrict the results to contain NO favourite                 conversations (false), ONLY favourite conversation (true), or ignore any restriction altogether (null)")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="The offset to start at")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number of conversations to this")] = None,
        mergeself: Annotated[Optional[StrictBool], Field(description="Whether to include self-conversations (true) or ONLY private                     conversations (false) when private conversations are requested.")] = None,
        type: Annotated[Optional[StrictInt], Field(description="Filter by type")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageGetConversationsResponse]:
        """Retrieve a list of conversations for a user

        Retrieve a list of conversations for a user

        :param userid: The id of the user who we are viewing conversations for (required)
        :type userid: int
        :param favourites: Whether to restrict the results to contain NO favourite                 conversations (false), ONLY favourite conversation (true), or ignore any restriction altogether (null)
        :type favourites: bool
        :param limitfrom: The offset to start at
        :type limitfrom: int
        :param limitnum: Limit number of conversations to this
        :type limitnum: int
        :param mergeself: Whether to include self-conversations (true) or ONLY private                     conversations (false) when private conversations are requested.
        :type mergeself: bool
        :param type: Filter by type
        :type type: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversations_serialize(
            userid=userid,
            favourites=favourites,
            limitfrom=limitfrom,
            limitnum=limitnum,
            mergeself=mergeself,
            type=type,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_conversations_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we are viewing conversations for")],
        favourites: Annotated[Optional[StrictBool], Field(description="Whether to restrict the results to contain NO favourite                 conversations (false), ONLY favourite conversation (true), or ignore any restriction altogether (null)")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="The offset to start at")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number of conversations to this")] = None,
        mergeself: Annotated[Optional[StrictBool], Field(description="Whether to include self-conversations (true) or ONLY private                     conversations (false) when private conversations are requested.")] = None,
        type: Annotated[Optional[StrictInt], Field(description="Filter by type")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve a list of conversations for a user

        Retrieve a list of conversations for a user

        :param userid: The id of the user who we are viewing conversations for (required)
        :type userid: int
        :param favourites: Whether to restrict the results to contain NO favourite                 conversations (false), ONLY favourite conversation (true), or ignore any restriction altogether (null)
        :type favourites: bool
        :param limitfrom: The offset to start at
        :type limitfrom: int
        :param limitnum: Limit number of conversations to this
        :type limitnum: int
        :param mergeself: Whether to include self-conversations (true) or ONLY private                     conversations (false) when private conversations are requested.
        :type mergeself: bool
        :param type: Filter by type
        :type type: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_conversations_serialize(
            userid=userid,
            favourites=favourites,
            limitfrom=limitfrom,
            limitnum=limitnum,
            mergeself=mergeself,
            type=type,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetConversationsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_conversations_serialize(
        self,
        userid,
        favourites,
        limitfrom,
        limitnum,
        mergeself,
        type,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_conversations'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_conversations'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_conversations',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if favourites is not None:
            _form_params += parse_form({'favourites': favourites})
        if limitfrom is not None:
            _form_params += parse_form({'limitfrom': limitfrom})
        if limitnum is not None:
            _form_params += parse_form({'limitnum': limitnum})
        if mergeself is not None:
            _form_params += parse_form({'mergeself': mergeself})
        if type is not None:
            _form_params += parse_form({'type': type})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_member_info_args(
        self,
        referenceuserid: Annotated[Optional[StrictInt], Field(description="id of the user")],
        userids: List[Optional[StrictInt]],
        includecontactrequests: Annotated[Optional[StrictBool], Field(description="include contact requests in response")] = None,
        includeprivacyinfo: Annotated[Optional[StrictBool], Field(description="include privacy info in response")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve a user message profiles

        Retrieve a user message profiles

        :param referenceuserid: id of the user (required)
        :type referenceuserid: int
        :param userids: (required)
        :type userids: List[Optional[int]]
        :param includecontactrequests: include contact requests in response
        :type includecontactrequests: bool
        :param includeprivacyinfo: include privacy info in response
        :type includeprivacyinfo: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_member_info_serialize(
            referenceuserid=referenceuserid,
            userids=userids,
            includecontactrequests=includecontactrequests,
            includeprivacyinfo=includeprivacyinfo,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_member_info(
        self,
        referenceuserid: Annotated[Optional[StrictInt], Field(description="id of the user")],
        userids: List[Optional[StrictInt]],
        includecontactrequests: Annotated[Optional[StrictBool], Field(description="include contact requests in response")] = None,
        includeprivacyinfo: Annotated[Optional[StrictBool], Field(description="include privacy info in response")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreMessageGetContactRequestsResponseInner]:
        """Retrieve a user message profiles

        Retrieve a user message profiles

        :param referenceuserid: id of the user (required)
        :type referenceuserid: int
        :param userids: (required)
        :type userids: List[Optional[int]]
        :param includecontactrequests: include contact requests in response
        :type includecontactrequests: bool
        :param includeprivacyinfo: include privacy info in response
        :type includeprivacyinfo: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_member_info_serialize(
            referenceuserid=referenceuserid,
            userids=userids,
            includecontactrequests=includecontactrequests,
            includeprivacyinfo=includeprivacyinfo,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_member_info_from_args(
        self,
        args
    ) -> List[CoreMessageGetContactRequestsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_member_info_with_http_info(
        self,
        referenceuserid: Annotated[Optional[StrictInt], Field(description="id of the user")],
        userids: List[Optional[StrictInt]],
        includecontactrequests: Annotated[Optional[StrictBool], Field(description="include contact requests in response")] = None,
        includeprivacyinfo: Annotated[Optional[StrictBool], Field(description="include privacy info in response")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreMessageGetContactRequestsResponseInner]]:
        """Retrieve a user message profiles

        Retrieve a user message profiles

        :param referenceuserid: id of the user (required)
        :type referenceuserid: int
        :param userids: (required)
        :type userids: List[Optional[int]]
        :param includecontactrequests: include contact requests in response
        :type includecontactrequests: bool
        :param includeprivacyinfo: include privacy info in response
        :type includeprivacyinfo: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_member_info_serialize(
            referenceuserid=referenceuserid,
            userids=userids,
            includecontactrequests=includecontactrequests,
            includeprivacyinfo=includeprivacyinfo,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_member_info_without_preload_content(
        self,
        referenceuserid: Annotated[Optional[StrictInt], Field(description="id of the user")],
        userids: List[Optional[StrictInt]],
        includecontactrequests: Annotated[Optional[StrictBool], Field(description="include contact requests in response")] = None,
        includeprivacyinfo: Annotated[Optional[StrictBool], Field(description="include privacy info in response")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve a user message profiles

        Retrieve a user message profiles

        :param referenceuserid: id of the user (required)
        :type referenceuserid: int
        :param userids: (required)
        :type userids: List[Optional[int]]
        :param includecontactrequests: include contact requests in response
        :type includecontactrequests: bool
        :param includeprivacyinfo: include privacy info in response
        :type includeprivacyinfo: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_member_info_serialize(
            referenceuserid=referenceuserid,
            userids=userids,
            includecontactrequests=includecontactrequests,
            includeprivacyinfo=includeprivacyinfo,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_member_info_serialize(
        self,
        referenceuserid,
        userids,
        includecontactrequests,
        includeprivacyinfo,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'userids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_member_info'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_member_info'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_member_info',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if includecontactrequests is not None:
            _form_params += parse_form({'includecontactrequests': includecontactrequests})
        if includeprivacyinfo is not None:
            _form_params += parse_form({'includeprivacyinfo': includeprivacyinfo})
        if referenceuserid is not None:
            _form_params += parse_form({'referenceuserid': referenceuserid})
        if userids is not None:
            _form_params += parse_form({'userids': userids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_message_processor_args(
        self,
        name: Annotated[Optional[StrictStr], Field(description="The name of the message processor")],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get a message processor

        Get a message processor

        :param name: The name of the message processor (required)
        :type name: str
        :param userid: id of the user, 0 for current user (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_message_processor_serialize(
            name=name,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetMessageProcessorResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_message_processor(
        self,
        name: Annotated[Optional[StrictStr], Field(description="The name of the message processor")],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageGetMessageProcessorResponse:
        """Get a message processor

        Get a message processor

        :param name: The name of the message processor (required)
        :type name: str
        :param userid: id of the user, 0 for current user (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_message_processor_serialize(
            name=name,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetMessageProcessorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_message_processor_from_args(
        self,
        args
    ) -> CoreMessageGetMessageProcessorResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetMessageProcessorResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_message_processor_with_http_info(
        self,
        name: Annotated[Optional[StrictStr], Field(description="The name of the message processor")],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageGetMessageProcessorResponse]:
        """Get a message processor

        Get a message processor

        :param name: The name of the message processor (required)
        :type name: str
        :param userid: id of the user, 0 for current user (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_message_processor_serialize(
            name=name,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetMessageProcessorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_message_processor_without_preload_content(
        self,
        name: Annotated[Optional[StrictStr], Field(description="The name of the message processor")],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get a message processor

        Get a message processor

        :param name: The name of the message processor (required)
        :type name: str
        :param userid: id of the user, 0 for current user (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_message_processor_serialize(
            name=name,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetMessageProcessorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_message_processor_serialize(
        self,
        name,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_message_processor'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_message_processor'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_message_processor',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if name is not None:
            _form_params += parse_form({'name': name})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_messages_args(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for any user")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="limit number")] = None,
        newestfirst: Annotated[Optional[StrictBool], Field(description="true for ordering by newest first, false for oldest first")] = None,
        read: Annotated[Optional[StrictInt], Field(description="1 for getting read messages, 0 for unread, 2 for both")] = None,
        type: Annotated[Optional[StrictStr], Field(description="type of message to return, expected values are: notifications, conversations and both")] = None,
        useridfrom: Annotated[Optional[StrictInt], Field(description="the user id who send the message, 0 for any user. -10 or -20 for no-reply or support user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve a list of messages sent and received by a user (conversations, notifications or both)

        Retrieve a list of messages sent and received by a user (conversations, notifications or both)

        :param useridto: the user id who received the message, 0 for any user (required)
        :type useridto: int
        :param limitfrom: limit from
        :type limitfrom: int
        :param limitnum: limit number
        :type limitnum: int
        :param newestfirst: true for ordering by newest first, false for oldest first
        :type newestfirst: bool
        :param read: 1 for getting read messages, 0 for unread, 2 for both
        :type read: int
        :param type: type of message to return, expected values are: notifications, conversations and both
        :type type: str
        :param useridfrom: the user id who send the message, 0 for any user. -10 or -20 for no-reply or support user
        :type useridfrom: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_messages_serialize(
            useridto=useridto,
            limitfrom=limitfrom,
            limitnum=limitnum,
            newestfirst=newestfirst,
            read=read,
            type=type,
            useridfrom=useridfrom,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetMessagesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_messages(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for any user")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="limit number")] = None,
        newestfirst: Annotated[Optional[StrictBool], Field(description="true for ordering by newest first, false for oldest first")] = None,
        read: Annotated[Optional[StrictInt], Field(description="1 for getting read messages, 0 for unread, 2 for both")] = None,
        type: Annotated[Optional[StrictStr], Field(description="type of message to return, expected values are: notifications, conversations and both")] = None,
        useridfrom: Annotated[Optional[StrictInt], Field(description="the user id who send the message, 0 for any user. -10 or -20 for no-reply or support user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageGetMessagesResponse:
        """Retrieve a list of messages sent and received by a user (conversations, notifications or both)

        Retrieve a list of messages sent and received by a user (conversations, notifications or both)

        :param useridto: the user id who received the message, 0 for any user (required)
        :type useridto: int
        :param limitfrom: limit from
        :type limitfrom: int
        :param limitnum: limit number
        :type limitnum: int
        :param newestfirst: true for ordering by newest first, false for oldest first
        :type newestfirst: bool
        :param read: 1 for getting read messages, 0 for unread, 2 for both
        :type read: int
        :param type: type of message to return, expected values are: notifications, conversations and both
        :type type: str
        :param useridfrom: the user id who send the message, 0 for any user. -10 or -20 for no-reply or support user
        :type useridfrom: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_messages_serialize(
            useridto=useridto,
            limitfrom=limitfrom,
            limitnum=limitnum,
            newestfirst=newestfirst,
            read=read,
            type=type,
            useridfrom=useridfrom,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetMessagesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_messages_from_args(
        self,
        args
    ) -> CoreMessageGetMessagesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetMessagesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_messages_with_http_info(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for any user")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="limit number")] = None,
        newestfirst: Annotated[Optional[StrictBool], Field(description="true for ordering by newest first, false for oldest first")] = None,
        read: Annotated[Optional[StrictInt], Field(description="1 for getting read messages, 0 for unread, 2 for both")] = None,
        type: Annotated[Optional[StrictStr], Field(description="type of message to return, expected values are: notifications, conversations and both")] = None,
        useridfrom: Annotated[Optional[StrictInt], Field(description="the user id who send the message, 0 for any user. -10 or -20 for no-reply or support user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageGetMessagesResponse]:
        """Retrieve a list of messages sent and received by a user (conversations, notifications or both)

        Retrieve a list of messages sent and received by a user (conversations, notifications or both)

        :param useridto: the user id who received the message, 0 for any user (required)
        :type useridto: int
        :param limitfrom: limit from
        :type limitfrom: int
        :param limitnum: limit number
        :type limitnum: int
        :param newestfirst: true for ordering by newest first, false for oldest first
        :type newestfirst: bool
        :param read: 1 for getting read messages, 0 for unread, 2 for both
        :type read: int
        :param type: type of message to return, expected values are: notifications, conversations and both
        :type type: str
        :param useridfrom: the user id who send the message, 0 for any user. -10 or -20 for no-reply or support user
        :type useridfrom: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_messages_serialize(
            useridto=useridto,
            limitfrom=limitfrom,
            limitnum=limitnum,
            newestfirst=newestfirst,
            read=read,
            type=type,
            useridfrom=useridfrom,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetMessagesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_messages_without_preload_content(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for any user")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="limit number")] = None,
        newestfirst: Annotated[Optional[StrictBool], Field(description="true for ordering by newest first, false for oldest first")] = None,
        read: Annotated[Optional[StrictInt], Field(description="1 for getting read messages, 0 for unread, 2 for both")] = None,
        type: Annotated[Optional[StrictStr], Field(description="type of message to return, expected values are: notifications, conversations and both")] = None,
        useridfrom: Annotated[Optional[StrictInt], Field(description="the user id who send the message, 0 for any user. -10 or -20 for no-reply or support user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve a list of messages sent and received by a user (conversations, notifications or both)

        Retrieve a list of messages sent and received by a user (conversations, notifications or both)

        :param useridto: the user id who received the message, 0 for any user (required)
        :type useridto: int
        :param limitfrom: limit from
        :type limitfrom: int
        :param limitnum: limit number
        :type limitnum: int
        :param newestfirst: true for ordering by newest first, false for oldest first
        :type newestfirst: bool
        :param read: 1 for getting read messages, 0 for unread, 2 for both
        :type read: int
        :param type: type of message to return, expected values are: notifications, conversations and both
        :type type: str
        :param useridfrom: the user id who send the message, 0 for any user. -10 or -20 for no-reply or support user
        :type useridfrom: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_messages_serialize(
            useridto=useridto,
            limitfrom=limitfrom,
            limitnum=limitnum,
            newestfirst=newestfirst,
            read=read,
            type=type,
            useridfrom=useridfrom,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetMessagesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_messages_serialize(
        self,
        useridto,
        limitfrom,
        limitnum,
        newestfirst,
        read,
        type,
        useridfrom,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_messages'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_messages'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_messages',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if limitfrom is not None:
            _form_params += parse_form({'limitfrom': limitfrom})
        if limitnum is not None:
            _form_params += parse_form({'limitnum': limitnum})
        if newestfirst is not None:
            _form_params += parse_form({'newestfirst': newestfirst})
        if read is not None:
            _form_params += parse_form({'read': read})
        if type is not None:
            _form_params += parse_form({'type': type})
        if useridfrom is not None:
            _form_params += parse_form({'useridfrom': useridfrom})
        if useridto is not None:
            _form_params += parse_form({'useridto': useridto})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_received_contact_requests_count_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user we want to return the number of received contact requests for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Gets the number of received contact requests

        Gets the number of received contact requests

        :param userid: The id of the user we want to return the number of received contact requests for (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_received_contact_requests_count_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_received_contact_requests_count(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user we want to return the number of received contact requests for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> int:
        """Gets the number of received contact requests

        Gets the number of received contact requests

        :param userid: The id of the user we want to return the number of received contact requests for (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_received_contact_requests_count_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_received_contact_requests_count_from_args(
        self,
        args
    ) -> int:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_received_contact_requests_count_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user we want to return the number of received contact requests for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[int]:
        """Gets the number of received contact requests

        Gets the number of received contact requests

        :param userid: The id of the user we want to return the number of received contact requests for (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_received_contact_requests_count_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_received_contact_requests_count_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user we want to return the number of received contact requests for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Gets the number of received contact requests

        Gets the number of received contact requests

        :param userid: The id of the user we want to return the number of received contact requests for (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_received_contact_requests_count_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_received_contact_requests_count_serialize(
        self,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_received_contact_requests_count'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_received_contact_requests_count'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_received_contact_requests_count',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_self_conversation_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we are viewing self-conversations for")],
        messagelimit: Annotated[Optional[StrictInt], Field(description="Limit for number of messages")] = None,
        messageoffset: Annotated[Optional[StrictInt], Field(description="Offset for messages list")] = None,
        newestmessagesfirst: Annotated[Optional[StrictBool], Field(description="Order messages by newest first")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve a self-conversation for a user

        Retrieve a self-conversation for a user

        :param userid: The id of the user who we are viewing self-conversations for (required)
        :type userid: int
        :param messagelimit: Limit for number of messages
        :type messagelimit: int
        :param messageoffset: Offset for messages list
        :type messageoffset: int
        :param newestmessagesfirst: Order messages by newest first
        :type newestmessagesfirst: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_self_conversation_serialize(
            userid=userid,
            messagelimit=messagelimit,
            messageoffset=messageoffset,
            newestmessagesfirst=newestmessagesfirst,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetSelfConversationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_self_conversation(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we are viewing self-conversations for")],
        messagelimit: Annotated[Optional[StrictInt], Field(description="Limit for number of messages")] = None,
        messageoffset: Annotated[Optional[StrictInt], Field(description="Offset for messages list")] = None,
        newestmessagesfirst: Annotated[Optional[StrictBool], Field(description="Order messages by newest first")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageGetSelfConversationResponse:
        """Retrieve a self-conversation for a user

        Retrieve a self-conversation for a user

        :param userid: The id of the user who we are viewing self-conversations for (required)
        :type userid: int
        :param messagelimit: Limit for number of messages
        :type messagelimit: int
        :param messageoffset: Offset for messages list
        :type messageoffset: int
        :param newestmessagesfirst: Order messages by newest first
        :type newestmessagesfirst: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_self_conversation_serialize(
            userid=userid,
            messagelimit=messagelimit,
            messageoffset=messageoffset,
            newestmessagesfirst=newestmessagesfirst,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetSelfConversationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_self_conversation_from_args(
        self,
        args
    ) -> CoreMessageGetSelfConversationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetSelfConversationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_self_conversation_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we are viewing self-conversations for")],
        messagelimit: Annotated[Optional[StrictInt], Field(description="Limit for number of messages")] = None,
        messageoffset: Annotated[Optional[StrictInt], Field(description="Offset for messages list")] = None,
        newestmessagesfirst: Annotated[Optional[StrictBool], Field(description="Order messages by newest first")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageGetSelfConversationResponse]:
        """Retrieve a self-conversation for a user

        Retrieve a self-conversation for a user

        :param userid: The id of the user who we are viewing self-conversations for (required)
        :type userid: int
        :param messagelimit: Limit for number of messages
        :type messagelimit: int
        :param messageoffset: Offset for messages list
        :type messageoffset: int
        :param newestmessagesfirst: Order messages by newest first
        :type newestmessagesfirst: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_self_conversation_serialize(
            userid=userid,
            messagelimit=messagelimit,
            messageoffset=messageoffset,
            newestmessagesfirst=newestmessagesfirst,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetSelfConversationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_self_conversation_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we are viewing self-conversations for")],
        messagelimit: Annotated[Optional[StrictInt], Field(description="Limit for number of messages")] = None,
        messageoffset: Annotated[Optional[StrictInt], Field(description="Offset for messages list")] = None,
        newestmessagesfirst: Annotated[Optional[StrictBool], Field(description="Order messages by newest first")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve a self-conversation for a user

        Retrieve a self-conversation for a user

        :param userid: The id of the user who we are viewing self-conversations for (required)
        :type userid: int
        :param messagelimit: Limit for number of messages
        :type messagelimit: int
        :param messageoffset: Offset for messages list
        :type messageoffset: int
        :param newestmessagesfirst: Order messages by newest first
        :type newestmessagesfirst: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_self_conversation_serialize(
            userid=userid,
            messagelimit=messagelimit,
            messageoffset=messageoffset,
            newestmessagesfirst=newestmessagesfirst,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetSelfConversationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_self_conversation_serialize(
        self,
        userid,
        messagelimit,
        messageoffset,
        newestmessagesfirst,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_self_conversation'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_self_conversation'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_self_conversation',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if messagelimit is not None:
            _form_params += parse_form({'messagelimit': messagelimit})
        if messageoffset is not None:
            _form_params += parse_form({'messageoffset': messageoffset})
        if newestmessagesfirst is not None:
            _form_params += parse_form({'newestmessagesfirst': newestmessagesfirst})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_unread_conversation_counts_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve a list of unread conversation counts, indexed by type.

        Retrieve a list of unread conversation counts, indexed by type.

        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_unread_conversation_counts_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUnreadConversationCountsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_unread_conversation_counts(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageGetUnreadConversationCountsResponse:
        """Retrieve a list of unread conversation counts, indexed by type.

        Retrieve a list of unread conversation counts, indexed by type.

        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_unread_conversation_counts_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUnreadConversationCountsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_unread_conversation_counts_from_args(
        self,
        args
    ) -> CoreMessageGetUnreadConversationCountsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUnreadConversationCountsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_unread_conversation_counts_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageGetUnreadConversationCountsResponse]:
        """Retrieve a list of unread conversation counts, indexed by type.

        Retrieve a list of unread conversation counts, indexed by type.

        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_unread_conversation_counts_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUnreadConversationCountsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_unread_conversation_counts_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve a list of unread conversation counts, indexed by type.

        Retrieve a list of unread conversation counts, indexed by type.

        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_unread_conversation_counts_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUnreadConversationCountsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_unread_conversation_counts_serialize(
        self,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_unread_conversation_counts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_unread_conversation_counts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_unread_conversation_counts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_unread_conversations_count_args(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for any user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve the count of unread conversations for a given user

        Retrieve the count of unread conversations for a given user

        :param useridto: the user id who received the message, 0 for any user (required)
        :type useridto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_unread_conversations_count_serialize(
            useridto=useridto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_unread_conversations_count(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for any user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> int:
        """Retrieve the count of unread conversations for a given user

        Retrieve the count of unread conversations for a given user

        :param useridto: the user id who received the message, 0 for any user (required)
        :type useridto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_unread_conversations_count_serialize(
            useridto=useridto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_unread_conversations_count_from_args(
        self,
        args
    ) -> int:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_unread_conversations_count_with_http_info(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for any user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[int]:
        """Retrieve the count of unread conversations for a given user

        Retrieve the count of unread conversations for a given user

        :param useridto: the user id who received the message, 0 for any user (required)
        :type useridto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_unread_conversations_count_serialize(
            useridto=useridto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_unread_conversations_count_without_preload_content(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for any user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve the count of unread conversations for a given user

        Retrieve the count of unread conversations for a given user

        :param useridto: the user id who received the message, 0 for any user (required)
        :type useridto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_unread_conversations_count_serialize(
            useridto=useridto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_unread_conversations_count_serialize(
        self,
        useridto,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_unread_conversations_count'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_unread_conversations_count'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_unread_conversations_count',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if useridto is not None:
            _form_params += parse_form({'useridto': useridto})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_unread_notification_count_args(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="user id who received the notification, 0 for any user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get number of unread notifications.

        Get number of unread notifications.

        :param useridto: user id who received the notification, 0 for any user (required)
        :type useridto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_unread_notification_count_serialize(
            useridto=useridto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_unread_notification_count(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="user id who received the notification, 0 for any user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> int:
        """Get number of unread notifications.

        Get number of unread notifications.

        :param useridto: user id who received the notification, 0 for any user (required)
        :type useridto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_unread_notification_count_serialize(
            useridto=useridto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_unread_notification_count_from_args(
        self,
        args
    ) -> int:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_unread_notification_count_with_http_info(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="user id who received the notification, 0 for any user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[int]:
        """Get number of unread notifications.

        Get number of unread notifications.

        :param useridto: user id who received the notification, 0 for any user (required)
        :type useridto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_unread_notification_count_serialize(
            useridto=useridto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_unread_notification_count_without_preload_content(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="user id who received the notification, 0 for any user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get number of unread notifications.

        Get number of unread notifications.

        :param useridto: user id who received the notification, 0 for any user (required)
        :type useridto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_unread_notification_count_serialize(
            useridto=useridto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_unread_notification_count_serialize(
        self,
        useridto,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_unread_notification_count'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_unread_notification_count'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_unread_notification_count',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if useridto is not None:
            _form_params += parse_form({'useridto': useridto})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_unsent_message_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get an unsent message string

        Get an unsent message string

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_unsent_message_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUnsentMessageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_unsent_message(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageGetUnsentMessageResponse:
        """Get an unsent message string

        Get an unsent message string

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_unsent_message_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUnsentMessageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_unsent_message_from_args(
        self,
        args
    ) -> CoreMessageGetUnsentMessageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUnsentMessageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_unsent_message_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageGetUnsentMessageResponse]:
        """Get an unsent message string

        Get an unsent message string

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_unsent_message_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUnsentMessageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_unsent_message_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get an unsent message string

        Get an unsent message string

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_unsent_message_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUnsentMessageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_unsent_message_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_unsent_message'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_unsent_message'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_unsent_message',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_user_contacts_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we retrieving the contacts for")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve the contact list

        Retrieve the contact list

        :param userid: The id of the user who we retrieving the contacts for (required)
        :type userid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_user_contacts_serialize(
            userid=userid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_user_contacts(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we retrieving the contacts for")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreMessageGetContactRequestsResponseInner]:
        """Retrieve the contact list

        Retrieve the contact list

        :param userid: The id of the user who we retrieving the contacts for (required)
        :type userid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_user_contacts_serialize(
            userid=userid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_user_contacts_from_args(
        self,
        args
    ) -> List[CoreMessageGetContactRequestsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_user_contacts_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we retrieving the contacts for")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreMessageGetContactRequestsResponseInner]]:
        """Retrieve the contact list

        Retrieve the contact list

        :param userid: The id of the user who we retrieving the contacts for (required)
        :type userid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_user_contacts_serialize(
            userid=userid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_user_contacts_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who we retrieving the contacts for")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve the contact list

        Retrieve the contact list

        :param userid: The id of the user who we retrieving the contacts for (required)
        :type userid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_user_contacts_serialize(
            userid=userid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetContactRequestsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_user_contacts_serialize(
        self,
        userid,
        limitfrom,
        limitnum,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_user_contacts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_user_contacts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_user_contacts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if limitfrom is not None:
            _form_params += parse_form({'limitfrom': limitfrom})
        if limitnum is not None:
            _form_params += parse_form({'limitnum': limitnum})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_user_message_preferences_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the message preferences for a given user.

        Get the message preferences for a given user.

        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_user_message_preferences_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUserMessagePreferencesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_user_message_preferences(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageGetUserMessagePreferencesResponse:
        """Get the message preferences for a given user.

        Get the message preferences for a given user.

        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_user_message_preferences_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUserMessagePreferencesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_user_message_preferences_from_args(
        self,
        args
    ) -> CoreMessageGetUserMessagePreferencesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUserMessagePreferencesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_user_message_preferences_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageGetUserMessagePreferencesResponse]:
        """Get the message preferences for a given user.

        Get the message preferences for a given user.

        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_user_message_preferences_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUserMessagePreferencesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_user_message_preferences_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the message preferences for a given user.

        Get the message preferences for a given user.

        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_user_message_preferences_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUserMessagePreferencesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_user_message_preferences_serialize(
        self,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_user_message_preferences'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_user_message_preferences'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_user_message_preferences',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_get_user_notification_preferences_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the notification preferences for a given user.

        Get the notification preferences for a given user.

        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_user_notification_preferences_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUserNotificationPreferencesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_get_user_notification_preferences(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageGetUserNotificationPreferencesResponse:
        """Get the notification preferences for a given user.

        Get the notification preferences for a given user.

        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_user_notification_preferences_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUserNotificationPreferencesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_user_notification_preferences_from_args(
        self,
        args
    ) -> CoreMessageGetUserNotificationPreferencesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUserNotificationPreferencesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_get_user_notification_preferences_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageGetUserNotificationPreferencesResponse]:
        """Get the notification preferences for a given user.

        Get the notification preferences for a given user.

        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_user_notification_preferences_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUserNotificationPreferencesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_get_user_notification_preferences_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the notification preferences for a given user.

        Get the notification preferences for a given user.

        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_get_user_notification_preferences_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageGetUserNotificationPreferencesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_get_user_notification_preferences_serialize(
        self,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_get_user_notification_preferences'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_get_user_notification_preferences'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_get_user_notification_preferences',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_mark_all_conversation_messages_as_read_args(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="The conversation id who who we are marking the messages as read for")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id who who we are marking the messages as read for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Mark all conversation messages as read for a given user

        Mark all conversation messages as read for a given user

        :param conversationid: The conversation id who who we are marking the messages as read for (required)
        :type conversationid: int
        :param userid: The user id who who we are marking the messages as read for (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mark_all_conversation_messages_as_read_serialize(
            conversationid=conversationid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_mark_all_conversation_messages_as_read(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="The conversation id who who we are marking the messages as read for")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id who who we are marking the messages as read for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Mark all conversation messages as read for a given user

        Mark all conversation messages as read for a given user

        :param conversationid: The conversation id who who we are marking the messages as read for (required)
        :type conversationid: int
        :param userid: The user id who who we are marking the messages as read for (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mark_all_conversation_messages_as_read_serialize(
            conversationid=conversationid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_mark_all_conversation_messages_as_read_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_mark_all_conversation_messages_as_read_with_http_info(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="The conversation id who who we are marking the messages as read for")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id who who we are marking the messages as read for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Mark all conversation messages as read for a given user

        Mark all conversation messages as read for a given user

        :param conversationid: The conversation id who who we are marking the messages as read for (required)
        :type conversationid: int
        :param userid: The user id who who we are marking the messages as read for (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mark_all_conversation_messages_as_read_serialize(
            conversationid=conversationid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_mark_all_conversation_messages_as_read_without_preload_content(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="The conversation id who who we are marking the messages as read for")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id who who we are marking the messages as read for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Mark all conversation messages as read for a given user

        Mark all conversation messages as read for a given user

        :param conversationid: The conversation id who who we are marking the messages as read for (required)
        :type conversationid: int
        :param userid: The user id who who we are marking the messages as read for (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mark_all_conversation_messages_as_read_serialize(
            conversationid=conversationid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_mark_all_conversation_messages_as_read_serialize(
        self,
        conversationid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_mark_all_conversation_messages_as_read'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_mark_all_conversation_messages_as_read'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_mark_all_conversation_messages_as_read',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if conversationid is not None:
            _form_params += parse_form({'conversationid': conversationid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_mark_all_notifications_as_read_args(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for any user")],
        timecreatedto: Annotated[Optional[StrictInt], Field(description="mark messages created before this time as read, 0 for all messages")] = None,
        useridfrom: Annotated[Optional[StrictInt], Field(description="the user id who send the message, 0 for any user. -10 or -20 for no-reply or support user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Mark all notifications as read for a given user

        Mark all notifications as read for a given user

        :param useridto: the user id who received the message, 0 for any user (required)
        :type useridto: int
        :param timecreatedto: mark messages created before this time as read, 0 for all messages
        :type timecreatedto: int
        :param useridfrom: the user id who send the message, 0 for any user. -10 or -20 for no-reply or support user
        :type useridfrom: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mark_all_notifications_as_read_serialize(
            useridto=useridto,
            timecreatedto=timecreatedto,
            useridfrom=useridfrom,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_mark_all_notifications_as_read(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for any user")],
        timecreatedto: Annotated[Optional[StrictInt], Field(description="mark messages created before this time as read, 0 for all messages")] = None,
        useridfrom: Annotated[Optional[StrictInt], Field(description="the user id who send the message, 0 for any user. -10 or -20 for no-reply or support user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Mark all notifications as read for a given user

        Mark all notifications as read for a given user

        :param useridto: the user id who received the message, 0 for any user (required)
        :type useridto: int
        :param timecreatedto: mark messages created before this time as read, 0 for all messages
        :type timecreatedto: int
        :param useridfrom: the user id who send the message, 0 for any user. -10 or -20 for no-reply or support user
        :type useridfrom: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mark_all_notifications_as_read_serialize(
            useridto=useridto,
            timecreatedto=timecreatedto,
            useridfrom=useridfrom,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_mark_all_notifications_as_read_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_mark_all_notifications_as_read_with_http_info(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for any user")],
        timecreatedto: Annotated[Optional[StrictInt], Field(description="mark messages created before this time as read, 0 for all messages")] = None,
        useridfrom: Annotated[Optional[StrictInt], Field(description="the user id who send the message, 0 for any user. -10 or -20 for no-reply or support user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Mark all notifications as read for a given user

        Mark all notifications as read for a given user

        :param useridto: the user id who received the message, 0 for any user (required)
        :type useridto: int
        :param timecreatedto: mark messages created before this time as read, 0 for all messages
        :type timecreatedto: int
        :param useridfrom: the user id who send the message, 0 for any user. -10 or -20 for no-reply or support user
        :type useridfrom: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mark_all_notifications_as_read_serialize(
            useridto=useridto,
            timecreatedto=timecreatedto,
            useridfrom=useridfrom,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_mark_all_notifications_as_read_without_preload_content(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for any user")],
        timecreatedto: Annotated[Optional[StrictInt], Field(description="mark messages created before this time as read, 0 for all messages")] = None,
        useridfrom: Annotated[Optional[StrictInt], Field(description="the user id who send the message, 0 for any user. -10 or -20 for no-reply or support user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Mark all notifications as read for a given user

        Mark all notifications as read for a given user

        :param useridto: the user id who received the message, 0 for any user (required)
        :type useridto: int
        :param timecreatedto: mark messages created before this time as read, 0 for all messages
        :type timecreatedto: int
        :param useridfrom: the user id who send the message, 0 for any user. -10 or -20 for no-reply or support user
        :type useridfrom: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mark_all_notifications_as_read_serialize(
            useridto=useridto,
            timecreatedto=timecreatedto,
            useridfrom=useridfrom,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_mark_all_notifications_as_read_serialize(
        self,
        useridto,
        timecreatedto,
        useridfrom,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_mark_all_notifications_as_read'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_mark_all_notifications_as_read'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_mark_all_notifications_as_read',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if timecreatedto is not None:
            _form_params += parse_form({'timecreatedto': timecreatedto})
        if useridfrom is not None:
            _form_params += parse_form({'useridfrom': useridfrom})
        if useridto is not None:
            _form_params += parse_form({'useridto': useridto})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_mark_message_read_args(
        self,
        messageid: Annotated[Optional[StrictInt], Field(description="id of the message in the messages table")],
        timeread: Annotated[Optional[StrictInt], Field(description="timestamp for when the message should be marked read")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Mark a single message as read, trigger message_viewed event.

        Mark a single message as read, trigger message_viewed event.

        :param messageid: id of the message in the messages table (required)
        :type messageid: int
        :param timeread: timestamp for when the message should be marked read
        :type timeread: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mark_message_read_serialize(
            messageid=messageid,
            timeread=timeread,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageMarkMessageReadResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_mark_message_read(
        self,
        messageid: Annotated[Optional[StrictInt], Field(description="id of the message in the messages table")],
        timeread: Annotated[Optional[StrictInt], Field(description="timestamp for when the message should be marked read")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageMarkMessageReadResponse:
        """Mark a single message as read, trigger message_viewed event.

        Mark a single message as read, trigger message_viewed event.

        :param messageid: id of the message in the messages table (required)
        :type messageid: int
        :param timeread: timestamp for when the message should be marked read
        :type timeread: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mark_message_read_serialize(
            messageid=messageid,
            timeread=timeread,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageMarkMessageReadResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_mark_message_read_from_args(
        self,
        args
    ) -> CoreMessageMarkMessageReadResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageMarkMessageReadResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_mark_message_read_with_http_info(
        self,
        messageid: Annotated[Optional[StrictInt], Field(description="id of the message in the messages table")],
        timeread: Annotated[Optional[StrictInt], Field(description="timestamp for when the message should be marked read")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageMarkMessageReadResponse]:
        """Mark a single message as read, trigger message_viewed event.

        Mark a single message as read, trigger message_viewed event.

        :param messageid: id of the message in the messages table (required)
        :type messageid: int
        :param timeread: timestamp for when the message should be marked read
        :type timeread: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mark_message_read_serialize(
            messageid=messageid,
            timeread=timeread,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageMarkMessageReadResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_mark_message_read_without_preload_content(
        self,
        messageid: Annotated[Optional[StrictInt], Field(description="id of the message in the messages table")],
        timeread: Annotated[Optional[StrictInt], Field(description="timestamp for when the message should be marked read")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Mark a single message as read, trigger message_viewed event.

        Mark a single message as read, trigger message_viewed event.

        :param messageid: id of the message in the messages table (required)
        :type messageid: int
        :param timeread: timestamp for when the message should be marked read
        :type timeread: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mark_message_read_serialize(
            messageid=messageid,
            timeread=timeread,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageMarkMessageReadResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_mark_message_read_serialize(
        self,
        messageid,
        timeread,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_mark_message_read'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_mark_message_read'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_mark_message_read',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if messageid is not None:
            _form_params += parse_form({'messageid': messageid})
        if timeread is not None:
            _form_params += parse_form({'timeread': timeread})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_mark_notification_read_args(
        self,
        notificationid: Annotated[Optional[StrictInt], Field(description="id of the notification")],
        timeread: Annotated[Optional[StrictInt], Field(description="timestamp for when the notification should be marked read")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Mark a single notification as read, trigger notification_viewed event.

        Mark a single notification as read, trigger notification_viewed event.

        :param notificationid: id of the notification (required)
        :type notificationid: int
        :param timeread: timestamp for when the notification should be marked read
        :type timeread: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mark_notification_read_serialize(
            notificationid=notificationid,
            timeread=timeread,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageMarkNotificationReadResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_mark_notification_read(
        self,
        notificationid: Annotated[Optional[StrictInt], Field(description="id of the notification")],
        timeread: Annotated[Optional[StrictInt], Field(description="timestamp for when the notification should be marked read")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageMarkNotificationReadResponse:
        """Mark a single notification as read, trigger notification_viewed event.

        Mark a single notification as read, trigger notification_viewed event.

        :param notificationid: id of the notification (required)
        :type notificationid: int
        :param timeread: timestamp for when the notification should be marked read
        :type timeread: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mark_notification_read_serialize(
            notificationid=notificationid,
            timeread=timeread,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageMarkNotificationReadResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_mark_notification_read_from_args(
        self,
        args
    ) -> CoreMessageMarkNotificationReadResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageMarkNotificationReadResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_mark_notification_read_with_http_info(
        self,
        notificationid: Annotated[Optional[StrictInt], Field(description="id of the notification")],
        timeread: Annotated[Optional[StrictInt], Field(description="timestamp for when the notification should be marked read")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageMarkNotificationReadResponse]:
        """Mark a single notification as read, trigger notification_viewed event.

        Mark a single notification as read, trigger notification_viewed event.

        :param notificationid: id of the notification (required)
        :type notificationid: int
        :param timeread: timestamp for when the notification should be marked read
        :type timeread: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mark_notification_read_serialize(
            notificationid=notificationid,
            timeread=timeread,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageMarkNotificationReadResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_mark_notification_read_without_preload_content(
        self,
        notificationid: Annotated[Optional[StrictInt], Field(description="id of the notification")],
        timeread: Annotated[Optional[StrictInt], Field(description="timestamp for when the notification should be marked read")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Mark a single notification as read, trigger notification_viewed event.

        Mark a single notification as read, trigger notification_viewed event.

        :param notificationid: id of the notification (required)
        :type notificationid: int
        :param timeread: timestamp for when the notification should be marked read
        :type timeread: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mark_notification_read_serialize(
            notificationid=notificationid,
            timeread=timeread,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageMarkNotificationReadResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_mark_notification_read_serialize(
        self,
        notificationid,
        timeread,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_mark_notification_read'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_mark_notification_read'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_mark_notification_read',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if notificationid is not None:
            _form_params += parse_form({'notificationid': notificationid})
        if timeread is not None:
            _form_params += parse_form({'timeread': timeread})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_message_processor_config_form_args(
        self,
        formvalues: Annotated[List[CoreMessageMessageProcessorConfigFormParametersFormvaluesInner], Field(description="Config form values")],
        name: Annotated[Optional[StrictStr], Field(description="The name of the message processor")],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Process the message processor config form

        Process the message processor config form

        :param formvalues: Config form values (required)
        :type formvalues: List[CoreMessageMessageProcessorConfigFormParametersFormvaluesInner]
        :param name: The name of the message processor (required)
        :type name: str
        :param userid: id of the user, 0 for current user (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_message_processor_config_form_serialize(
            formvalues=formvalues,
            name=name,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_message_processor_config_form(
        self,
        formvalues: Annotated[List[CoreMessageMessageProcessorConfigFormParametersFormvaluesInner], Field(description="Config form values")],
        name: Annotated[Optional[StrictStr], Field(description="The name of the message processor")],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Process the message processor config form

        Process the message processor config form

        :param formvalues: Config form values (required)
        :type formvalues: List[CoreMessageMessageProcessorConfigFormParametersFormvaluesInner]
        :param name: The name of the message processor (required)
        :type name: str
        :param userid: id of the user, 0 for current user (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_message_processor_config_form_serialize(
            formvalues=formvalues,
            name=name,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_message_processor_config_form_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_message_processor_config_form_with_http_info(
        self,
        formvalues: Annotated[List[CoreMessageMessageProcessorConfigFormParametersFormvaluesInner], Field(description="Config form values")],
        name: Annotated[Optional[StrictStr], Field(description="The name of the message processor")],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Process the message processor config form

        Process the message processor config form

        :param formvalues: Config form values (required)
        :type formvalues: List[CoreMessageMessageProcessorConfigFormParametersFormvaluesInner]
        :param name: The name of the message processor (required)
        :type name: str
        :param userid: id of the user, 0 for current user (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_message_processor_config_form_serialize(
            formvalues=formvalues,
            name=name,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_message_processor_config_form_without_preload_content(
        self,
        formvalues: Annotated[List[CoreMessageMessageProcessorConfigFormParametersFormvaluesInner], Field(description="Config form values")],
        name: Annotated[Optional[StrictStr], Field(description="The name of the message processor")],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Process the message processor config form

        Process the message processor config form

        :param formvalues: Config form values (required)
        :type formvalues: List[CoreMessageMessageProcessorConfigFormParametersFormvaluesInner]
        :param name: The name of the message processor (required)
        :type name: str
        :param userid: id of the user, 0 for current user (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_message_processor_config_form_serialize(
            formvalues=formvalues,
            name=name,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_message_processor_config_form_serialize(
        self,
        formvalues,
        name,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'formvalues': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_message_message_processor_config_form'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_message_processor_config_form'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_message_processor_config_form',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if formvalues is not None:
            _form_params += parse_form({'formvalues': formvalues})
        if name is not None:
            _form_params += parse_form({'name': name})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_message_search_users_args(
        self,
        search: Annotated[Optional[StrictStr], Field(description="The string being searched")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is performing the search")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve the data for searching for people

        Retrieve the data for searching for people

        :param search: The string being searched (required)
        :type search: str
        :param userid: The id of the user who is performing the search (required)
        :type userid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_message_search_users_serialize(
            search=search,
            userid=userid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageMessageSearchUsersResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_message_search_users(
        self,
        search: Annotated[Optional[StrictStr], Field(description="The string being searched")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is performing the search")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageMessageSearchUsersResponse:
        """Retrieve the data for searching for people

        Retrieve the data for searching for people

        :param search: The string being searched (required)
        :type search: str
        :param userid: The id of the user who is performing the search (required)
        :type userid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_message_search_users_serialize(
            search=search,
            userid=userid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageMessageSearchUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_message_search_users_from_args(
        self,
        args
    ) -> CoreMessageMessageSearchUsersResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageMessageSearchUsersResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_message_search_users_with_http_info(
        self,
        search: Annotated[Optional[StrictStr], Field(description="The string being searched")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is performing the search")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageMessageSearchUsersResponse]:
        """Retrieve the data for searching for people

        Retrieve the data for searching for people

        :param search: The string being searched (required)
        :type search: str
        :param userid: The id of the user who is performing the search (required)
        :type userid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_message_search_users_serialize(
            search=search,
            userid=userid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageMessageSearchUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_message_search_users_without_preload_content(
        self,
        search: Annotated[Optional[StrictStr], Field(description="The string being searched")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is performing the search")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Limit from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Limit number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve the data for searching for people

        Retrieve the data for searching for people

        :param search: The string being searched (required)
        :type search: str
        :param userid: The id of the user who is performing the search (required)
        :type userid: int
        :param limitfrom: Limit from
        :type limitfrom: int
        :param limitnum: Limit number
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_message_search_users_serialize(
            search=search,
            userid=userid,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageMessageSearchUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_message_search_users_serialize(
        self,
        search,
        userid,
        limitfrom,
        limitnum,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_message_search_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_message_search_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_message_search_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if limitfrom is not None:
            _form_params += parse_form({'limitfrom': limitfrom})
        if limitnum is not None:
            _form_params += parse_form({'limitnum': limitnum})
        if search is not None:
            _form_params += parse_form({'search': search})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_mute_conversations_args(
        self,
        conversationids: List[Optional[StrictInt]],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is blocking")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Mutes a list of conversations

        Mutes a list of conversations

        :param conversationids: (required)
        :type conversationids: List[Optional[int]]
        :param userid: The id of the user who is blocking (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mute_conversations_serialize(
            conversationids=conversationids,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_mute_conversations(
        self,
        conversationids: List[Optional[StrictInt]],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is blocking")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Mutes a list of conversations

        Mutes a list of conversations

        :param conversationids: (required)
        :type conversationids: List[Optional[int]]
        :param userid: The id of the user who is blocking (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mute_conversations_serialize(
            conversationids=conversationids,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_mute_conversations_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_mute_conversations_with_http_info(
        self,
        conversationids: List[Optional[StrictInt]],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is blocking")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Mutes a list of conversations

        Mutes a list of conversations

        :param conversationids: (required)
        :type conversationids: List[Optional[int]]
        :param userid: The id of the user who is blocking (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mute_conversations_serialize(
            conversationids=conversationids,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_mute_conversations_without_preload_content(
        self,
        conversationids: List[Optional[StrictInt]],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is blocking")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Mutes a list of conversations

        Mutes a list of conversations

        :param conversationids: (required)
        :type conversationids: List[Optional[int]]
        :param userid: The id of the user who is blocking (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_mute_conversations_serialize(
            conversationids=conversationids,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_mute_conversations_serialize(
        self,
        conversationids,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'conversationids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_message_mute_conversations'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_mute_conversations'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_mute_conversations',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if conversationids is not None:
            _form_params += parse_form({'conversationids': conversationids})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_search_contacts_args(
        self,
        searchtext: Annotated[Optional[StrictStr], Field(description="String the user's fullname has to match to be found")],
        onlymycourses: Annotated[Optional[StrictBool], Field(description="Limit search to the user's courses")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Search for contacts

        Search for contacts

        :param searchtext: String the user's fullname has to match to be found (required)
        :type searchtext: str
        :param onlymycourses: Limit search to the user's courses
        :type onlymycourses: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_search_contacts_serialize(
            searchtext=searchtext,
            onlymycourses=onlymycourses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageSearchContactsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_search_contacts(
        self,
        searchtext: Annotated[Optional[StrictStr], Field(description="String the user's fullname has to match to be found")],
        onlymycourses: Annotated[Optional[StrictBool], Field(description="Limit search to the user's courses")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreMessageSearchContactsResponseInner]:
        """Search for contacts

        Search for contacts

        :param searchtext: String the user's fullname has to match to be found (required)
        :type searchtext: str
        :param onlymycourses: Limit search to the user's courses
        :type onlymycourses: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_search_contacts_serialize(
            searchtext=searchtext,
            onlymycourses=onlymycourses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageSearchContactsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_search_contacts_from_args(
        self,
        args
    ) -> List[CoreMessageSearchContactsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageSearchContactsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_search_contacts_with_http_info(
        self,
        searchtext: Annotated[Optional[StrictStr], Field(description="String the user's fullname has to match to be found")],
        onlymycourses: Annotated[Optional[StrictBool], Field(description="Limit search to the user's courses")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreMessageSearchContactsResponseInner]]:
        """Search for contacts

        Search for contacts

        :param searchtext: String the user's fullname has to match to be found (required)
        :type searchtext: str
        :param onlymycourses: Limit search to the user's courses
        :type onlymycourses: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_search_contacts_serialize(
            searchtext=searchtext,
            onlymycourses=onlymycourses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageSearchContactsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_search_contacts_without_preload_content(
        self,
        searchtext: Annotated[Optional[StrictStr], Field(description="String the user's fullname has to match to be found")],
        onlymycourses: Annotated[Optional[StrictBool], Field(description="Limit search to the user's courses")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Search for contacts

        Search for contacts

        :param searchtext: String the user's fullname has to match to be found (required)
        :type searchtext: str
        :param onlymycourses: Limit search to the user's courses
        :type onlymycourses: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_search_contacts_serialize(
            searchtext=searchtext,
            onlymycourses=onlymycourses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageSearchContactsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_search_contacts_serialize(
        self,
        searchtext,
        onlymycourses,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_search_contacts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_search_contacts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_search_contacts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if onlymycourses is not None:
            _form_params += parse_form({'onlymycourses': onlymycourses})
        if searchtext is not None:
            _form_params += parse_form({'searchtext': searchtext})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_send_instant_messages_args(
        self,
        messages: List[CoreMessageSendInstantMessagesParametersMessagesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Send instant messages

        Send instant messages

        :param messages: (required)
        :type messages: List[CoreMessageSendInstantMessagesParametersMessagesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_send_instant_messages_serialize(
            messages=messages,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageSendInstantMessagesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_send_instant_messages(
        self,
        messages: List[CoreMessageSendInstantMessagesParametersMessagesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreMessageSendInstantMessagesResponseInner]:
        """Send instant messages

        Send instant messages

        :param messages: (required)
        :type messages: List[CoreMessageSendInstantMessagesParametersMessagesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_send_instant_messages_serialize(
            messages=messages,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageSendInstantMessagesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_send_instant_messages_from_args(
        self,
        args
    ) -> List[CoreMessageSendInstantMessagesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageSendInstantMessagesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_send_instant_messages_with_http_info(
        self,
        messages: List[CoreMessageSendInstantMessagesParametersMessagesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreMessageSendInstantMessagesResponseInner]]:
        """Send instant messages

        Send instant messages

        :param messages: (required)
        :type messages: List[CoreMessageSendInstantMessagesParametersMessagesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_send_instant_messages_serialize(
            messages=messages,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageSendInstantMessagesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_send_instant_messages_without_preload_content(
        self,
        messages: List[CoreMessageSendInstantMessagesParametersMessagesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Send instant messages

        Send instant messages

        :param messages: (required)
        :type messages: List[CoreMessageSendInstantMessagesParametersMessagesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_send_instant_messages_serialize(
            messages=messages,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageSendInstantMessagesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_send_instant_messages_serialize(
        self,
        messages,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'messages': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_message_send_instant_messages'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_send_instant_messages'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_send_instant_messages',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if messages is not None:
            _form_params += parse_form({'messages': messages})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_send_messages_to_conversation_args(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="id of the conversation")],
        messages: List[CoreMessageSendMessagesToConversationParametersMessagesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Send messages to an existing conversation between users

        Send messages to an existing conversation between users

        :param conversationid: id of the conversation (required)
        :type conversationid: int
        :param messages: (required)
        :type messages: List[CoreMessageSendMessagesToConversationParametersMessagesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_send_messages_to_conversation_serialize(
            conversationid=conversationid,
            messages=messages,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetConversationBetweenUsersResponseMessagesInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_send_messages_to_conversation(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="id of the conversation")],
        messages: List[CoreMessageSendMessagesToConversationParametersMessagesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreMessageGetConversationBetweenUsersResponseMessagesInner]:
        """Send messages to an existing conversation between users

        Send messages to an existing conversation between users

        :param conversationid: id of the conversation (required)
        :type conversationid: int
        :param messages: (required)
        :type messages: List[CoreMessageSendMessagesToConversationParametersMessagesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_send_messages_to_conversation_serialize(
            conversationid=conversationid,
            messages=messages,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetConversationBetweenUsersResponseMessagesInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_send_messages_to_conversation_from_args(
        self,
        args
    ) -> List[CoreMessageGetConversationBetweenUsersResponseMessagesInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetConversationBetweenUsersResponseMessagesInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_send_messages_to_conversation_with_http_info(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="id of the conversation")],
        messages: List[CoreMessageSendMessagesToConversationParametersMessagesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreMessageGetConversationBetweenUsersResponseMessagesInner]]:
        """Send messages to an existing conversation between users

        Send messages to an existing conversation between users

        :param conversationid: id of the conversation (required)
        :type conversationid: int
        :param messages: (required)
        :type messages: List[CoreMessageSendMessagesToConversationParametersMessagesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_send_messages_to_conversation_serialize(
            conversationid=conversationid,
            messages=messages,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetConversationBetweenUsersResponseMessagesInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_send_messages_to_conversation_without_preload_content(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="id of the conversation")],
        messages: List[CoreMessageSendMessagesToConversationParametersMessagesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Send messages to an existing conversation between users

        Send messages to an existing conversation between users

        :param conversationid: id of the conversation (required)
        :type conversationid: int
        :param messages: (required)
        :type messages: List[CoreMessageSendMessagesToConversationParametersMessagesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_send_messages_to_conversation_serialize(
            conversationid=conversationid,
            messages=messages,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreMessageGetConversationBetweenUsersResponseMessagesInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_send_messages_to_conversation_serialize(
        self,
        conversationid,
        messages,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'messages': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_message_send_messages_to_conversation'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_send_messages_to_conversation'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_send_messages_to_conversation',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if conversationid is not None:
            _form_params += parse_form({'conversationid': conversationid})
        if messages is not None:
            _form_params += parse_form({'messages': messages})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_set_default_notification_args(
        self,
        preference: Annotated[Optional[StrictStr], Field(description="The name of the preference")],
        state: Annotated[Optional[StrictInt], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set the default value for a given notification preference

        Set the default value for a given notification preference

        :param preference: The name of the preference (required)
        :type preference: str
        :param state: The target state (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_set_default_notification_serialize(
            preference=preference,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageSetDefaultNotificationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_set_default_notification(
        self,
        preference: Annotated[Optional[StrictStr], Field(description="The name of the preference")],
        state: Annotated[Optional[StrictInt], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMessageSetDefaultNotificationResponse:
        """Set the default value for a given notification preference

        Set the default value for a given notification preference

        :param preference: The name of the preference (required)
        :type preference: str
        :param state: The target state (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_set_default_notification_serialize(
            preference=preference,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageSetDefaultNotificationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_set_default_notification_from_args(
        self,
        args
    ) -> CoreMessageSetDefaultNotificationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageSetDefaultNotificationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_set_default_notification_with_http_info(
        self,
        preference: Annotated[Optional[StrictStr], Field(description="The name of the preference")],
        state: Annotated[Optional[StrictInt], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMessageSetDefaultNotificationResponse]:
        """Set the default value for a given notification preference

        Set the default value for a given notification preference

        :param preference: The name of the preference (required)
        :type preference: str
        :param state: The target state (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_set_default_notification_serialize(
            preference=preference,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageSetDefaultNotificationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_set_default_notification_without_preload_content(
        self,
        preference: Annotated[Optional[StrictStr], Field(description="The name of the preference")],
        state: Annotated[Optional[StrictInt], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set the default value for a given notification preference

        Set the default value for a given notification preference

        :param preference: The name of the preference (required)
        :type preference: str
        :param state: The target state (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_set_default_notification_serialize(
            preference=preference,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMessageSetDefaultNotificationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_set_default_notification_serialize(
        self,
        preference,
        state,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_set_default_notification'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_set_default_notification'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_set_default_notification',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if preference is not None:
            _form_params += parse_form({'preference': preference})
        if state is not None:
            _form_params += parse_form({'state': state})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_set_favourite_conversations_args(
        self,
        conversations: List[Optional[StrictInt]],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Mark a conversation or group of conversations as favourites/starred conversations.

        Mark a conversation or group of conversations as favourites/starred conversations.

        :param conversations: (required)
        :type conversations: List[Optional[int]]
        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_set_favourite_conversations_serialize(
            conversations=conversations,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_set_favourite_conversations(
        self,
        conversations: List[Optional[StrictInt]],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Mark a conversation or group of conversations as favourites/starred conversations.

        Mark a conversation or group of conversations as favourites/starred conversations.

        :param conversations: (required)
        :type conversations: List[Optional[int]]
        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_set_favourite_conversations_serialize(
            conversations=conversations,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_set_favourite_conversations_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_set_favourite_conversations_with_http_info(
        self,
        conversations: List[Optional[StrictInt]],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Mark a conversation or group of conversations as favourites/starred conversations.

        Mark a conversation or group of conversations as favourites/starred conversations.

        :param conversations: (required)
        :type conversations: List[Optional[int]]
        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_set_favourite_conversations_serialize(
            conversations=conversations,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_set_favourite_conversations_without_preload_content(
        self,
        conversations: List[Optional[StrictInt]],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Mark a conversation or group of conversations as favourites/starred conversations.

        Mark a conversation or group of conversations as favourites/starred conversations.

        :param conversations: (required)
        :type conversations: List[Optional[int]]
        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_set_favourite_conversations_serialize(
            conversations=conversations,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_set_favourite_conversations_serialize(
        self,
        conversations,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'conversations': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_message_set_favourite_conversations'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_set_favourite_conversations'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_set_favourite_conversations',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if conversations is not None:
            _form_params += parse_form({'conversations': conversations})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_set_unsent_message_args(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="The conversation id")],
        message: Annotated[Optional[StrictStr], Field(description="The message string")],
        otheruserid: Annotated[Optional[StrictInt], Field(description="The other user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Store an unsent message string

        Store an unsent message string

        :param conversationid: The conversation id (required)
        :type conversationid: int
        :param message: The message string (required)
        :type message: str
        :param otheruserid: The other user id (required)
        :type otheruserid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_set_unsent_message_serialize(
            conversationid=conversationid,
            message=message,
            otheruserid=otheruserid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_set_unsent_message(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="The conversation id")],
        message: Annotated[Optional[StrictStr], Field(description="The message string")],
        otheruserid: Annotated[Optional[StrictInt], Field(description="The other user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Store an unsent message string

        Store an unsent message string

        :param conversationid: The conversation id (required)
        :type conversationid: int
        :param message: The message string (required)
        :type message: str
        :param otheruserid: The other user id (required)
        :type otheruserid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_set_unsent_message_serialize(
            conversationid=conversationid,
            message=message,
            otheruserid=otheruserid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_set_unsent_message_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_set_unsent_message_with_http_info(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="The conversation id")],
        message: Annotated[Optional[StrictStr], Field(description="The message string")],
        otheruserid: Annotated[Optional[StrictInt], Field(description="The other user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Store an unsent message string

        Store an unsent message string

        :param conversationid: The conversation id (required)
        :type conversationid: int
        :param message: The message string (required)
        :type message: str
        :param otheruserid: The other user id (required)
        :type otheruserid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_set_unsent_message_serialize(
            conversationid=conversationid,
            message=message,
            otheruserid=otheruserid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_set_unsent_message_without_preload_content(
        self,
        conversationid: Annotated[Optional[StrictInt], Field(description="The conversation id")],
        message: Annotated[Optional[StrictStr], Field(description="The message string")],
        otheruserid: Annotated[Optional[StrictInt], Field(description="The other user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Store an unsent message string

        Store an unsent message string

        :param conversationid: The conversation id (required)
        :type conversationid: int
        :param message: The message string (required)
        :type message: str
        :param otheruserid: The other user id (required)
        :type otheruserid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_set_unsent_message_serialize(
            conversationid=conversationid,
            message=message,
            otheruserid=otheruserid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_set_unsent_message_serialize(
        self,
        conversationid,
        message,
        otheruserid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_set_unsent_message'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_set_unsent_message'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_set_unsent_message',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if conversationid is not None:
            _form_params += parse_form({'conversationid': conversationid})
        if message is not None:
            _form_params += parse_form({'message': message})
        if otheruserid is not None:
            _form_params += parse_form({'otheruserid': otheruserid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_unblock_user_args(
        self,
        unblockeduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being unblocked")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is unblocking")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Unblocks a user

        Unblocks a user

        :param unblockeduserid: The id of the user being unblocked (required)
        :type unblockeduserid: int
        :param userid: The id of the user who is unblocking (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_unblock_user_serialize(
            unblockeduserid=unblockeduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_unblock_user(
        self,
        unblockeduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being unblocked")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is unblocking")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Unblocks a user

        Unblocks a user

        :param unblockeduserid: The id of the user being unblocked (required)
        :type unblockeduserid: int
        :param userid: The id of the user who is unblocking (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_unblock_user_serialize(
            unblockeduserid=unblockeduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_unblock_user_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_unblock_user_with_http_info(
        self,
        unblockeduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being unblocked")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is unblocking")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Unblocks a user

        Unblocks a user

        :param unblockeduserid: The id of the user being unblocked (required)
        :type unblockeduserid: int
        :param userid: The id of the user who is unblocking (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_unblock_user_serialize(
            unblockeduserid=unblockeduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_unblock_user_without_preload_content(
        self,
        unblockeduserid: Annotated[Optional[StrictInt], Field(description="The id of the user being unblocked")],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is unblocking")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Unblocks a user

        Unblocks a user

        :param unblockeduserid: The id of the user being unblocked (required)
        :type unblockeduserid: int
        :param userid: The id of the user who is unblocking (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_unblock_user_serialize(
            unblockeduserid=unblockeduserid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_unblock_user_serialize(
        self,
        unblockeduserid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_message_unblock_user'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_unblock_user'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_unblock_user',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if unblockeduserid is not None:
            _form_params += parse_form({'unblockeduserid': unblockeduserid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_unmute_conversations_args(
        self,
        conversationids: List[Optional[StrictInt]],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is unblocking")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Unmutes a list of conversations

        Unmutes a list of conversations

        :param conversationids: (required)
        :type conversationids: List[Optional[int]]
        :param userid: The id of the user who is unblocking (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_unmute_conversations_serialize(
            conversationids=conversationids,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_unmute_conversations(
        self,
        conversationids: List[Optional[StrictInt]],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is unblocking")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Unmutes a list of conversations

        Unmutes a list of conversations

        :param conversationids: (required)
        :type conversationids: List[Optional[int]]
        :param userid: The id of the user who is unblocking (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_unmute_conversations_serialize(
            conversationids=conversationids,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_unmute_conversations_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_unmute_conversations_with_http_info(
        self,
        conversationids: List[Optional[StrictInt]],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is unblocking")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Unmutes a list of conversations

        Unmutes a list of conversations

        :param conversationids: (required)
        :type conversationids: List[Optional[int]]
        :param userid: The id of the user who is unblocking (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_unmute_conversations_serialize(
            conversationids=conversationids,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_unmute_conversations_without_preload_content(
        self,
        conversationids: List[Optional[StrictInt]],
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user who is unblocking")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Unmutes a list of conversations

        Unmutes a list of conversations

        :param conversationids: (required)
        :type conversationids: List[Optional[int]]
        :param userid: The id of the user who is unblocking (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_unmute_conversations_serialize(
            conversationids=conversationids,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_unmute_conversations_serialize(
        self,
        conversationids,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'conversationids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_message_unmute_conversations'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_unmute_conversations'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_unmute_conversations',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if conversationids is not None:
            _form_params += parse_form({'conversationids': conversationids})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_message_unset_favourite_conversations_args(
        self,
        conversations: List[Optional[StrictInt]],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Unset a conversation or group of conversations as favourites/starred conversations.

        Unset a conversation or group of conversations as favourites/starred conversations.

        :param conversations: (required)
        :type conversations: List[Optional[int]]
        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_unset_favourite_conversations_serialize(
            conversations=conversations,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_message_unset_favourite_conversations(
        self,
        conversations: List[Optional[StrictInt]],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Unset a conversation or group of conversations as favourites/starred conversations.

        Unset a conversation or group of conversations as favourites/starred conversations.

        :param conversations: (required)
        :type conversations: List[Optional[int]]
        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_unset_favourite_conversations_serialize(
            conversations=conversations,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_unset_favourite_conversations_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_message_unset_favourite_conversations_with_http_info(
        self,
        conversations: List[Optional[StrictInt]],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Unset a conversation or group of conversations as favourites/starred conversations.

        Unset a conversation or group of conversations as favourites/starred conversations.

        :param conversations: (required)
        :type conversations: List[Optional[int]]
        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_unset_favourite_conversations_serialize(
            conversations=conversations,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_message_unset_favourite_conversations_without_preload_content(
        self,
        conversations: List[Optional[StrictInt]],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Unset a conversation or group of conversations as favourites/starred conversations.

        Unset a conversation or group of conversations as favourites/starred conversations.

        :param conversations: (required)
        :type conversations: List[Optional[int]]
        :param userid: id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_message_unset_favourite_conversations_serialize(
            conversations=conversations,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_message_unset_favourite_conversations_serialize(
        self,
        conversations,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'conversations': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_message_unset_favourite_conversations'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_message_unset_favourite_conversations'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_message_unset_favourite_conversations',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if conversations is not None:
            _form_params += parse_form({'conversations': conversations})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_moodlenet_auth_check_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        issuerid: Annotated[Optional[StrictInt], Field(description="OAuth 2 issuer ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Check a user has authorized for a given MoodleNet site

        Check a user has authorized for a given MoodleNet site

        :param courseid: Course ID (required)
        :type courseid: int
        :param issuerid: OAuth 2 issuer ID (required)
        :type issuerid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_auth_check_serialize(
            courseid=courseid,
            issuerid=issuerid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetAuthCheckResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_moodlenet_auth_check(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        issuerid: Annotated[Optional[StrictInt], Field(description="OAuth 2 issuer ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMoodlenetAuthCheckResponse:
        """Check a user has authorized for a given MoodleNet site

        Check a user has authorized for a given MoodleNet site

        :param courseid: Course ID (required)
        :type courseid: int
        :param issuerid: OAuth 2 issuer ID (required)
        :type issuerid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_auth_check_serialize(
            courseid=courseid,
            issuerid=issuerid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetAuthCheckResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_moodlenet_auth_check_from_args(
        self,
        args
    ) -> CoreMoodlenetAuthCheckResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetAuthCheckResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_moodlenet_auth_check_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        issuerid: Annotated[Optional[StrictInt], Field(description="OAuth 2 issuer ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMoodlenetAuthCheckResponse]:
        """Check a user has authorized for a given MoodleNet site

        Check a user has authorized for a given MoodleNet site

        :param courseid: Course ID (required)
        :type courseid: int
        :param issuerid: OAuth 2 issuer ID (required)
        :type issuerid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_auth_check_serialize(
            courseid=courseid,
            issuerid=issuerid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetAuthCheckResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_moodlenet_auth_check_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        issuerid: Annotated[Optional[StrictInt], Field(description="OAuth 2 issuer ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Check a user has authorized for a given MoodleNet site

        Check a user has authorized for a given MoodleNet site

        :param courseid: Course ID (required)
        :type courseid: int
        :param issuerid: OAuth 2 issuer ID (required)
        :type issuerid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_auth_check_serialize(
            courseid=courseid,
            issuerid=issuerid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetAuthCheckResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_moodlenet_auth_check_serialize(
        self,
        courseid,
        issuerid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_moodlenet_auth_check'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_moodlenet_auth_check'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_moodlenet_auth_check',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if issuerid is not None:
            _form_params += parse_form({'issuerid': issuerid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_moodlenet_get_share_info_activity_args(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The cmid of the activity")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get information about an activity being shared

        Get information about an activity being shared

        :param cmid: The cmid of the activity (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_get_share_info_activity_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetGetShareInfoActivityResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_moodlenet_get_share_info_activity(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The cmid of the activity")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMoodlenetGetShareInfoActivityResponse:
        """Get information about an activity being shared

        Get information about an activity being shared

        :param cmid: The cmid of the activity (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_get_share_info_activity_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetGetShareInfoActivityResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_moodlenet_get_share_info_activity_from_args(
        self,
        args
    ) -> CoreMoodlenetGetShareInfoActivityResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetGetShareInfoActivityResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_moodlenet_get_share_info_activity_with_http_info(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The cmid of the activity")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMoodlenetGetShareInfoActivityResponse]:
        """Get information about an activity being shared

        Get information about an activity being shared

        :param cmid: The cmid of the activity (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_get_share_info_activity_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetGetShareInfoActivityResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_moodlenet_get_share_info_activity_without_preload_content(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The cmid of the activity")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get information about an activity being shared

        Get information about an activity being shared

        :param cmid: The cmid of the activity (required)
        :type cmid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_get_share_info_activity_serialize(
            cmid=cmid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetGetShareInfoActivityResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_moodlenet_get_share_info_activity_serialize(
        self,
        cmid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_moodlenet_get_share_info_activity'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_moodlenet_get_share_info_activity'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_moodlenet_get_share_info_activity',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_moodlenet_get_shared_course_info_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get information about an course being shared

        Get information about an course being shared

        :param courseid: The course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_get_shared_course_info_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetGetSharedCourseInfoResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_moodlenet_get_shared_course_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMoodlenetGetSharedCourseInfoResponse:
        """Get information about an course being shared

        Get information about an course being shared

        :param courseid: The course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_get_shared_course_info_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetGetSharedCourseInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_moodlenet_get_shared_course_info_from_args(
        self,
        args
    ) -> CoreMoodlenetGetSharedCourseInfoResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetGetSharedCourseInfoResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_moodlenet_get_shared_course_info_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMoodlenetGetSharedCourseInfoResponse]:
        """Get information about an course being shared

        Get information about an course being shared

        :param courseid: The course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_get_shared_course_info_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetGetSharedCourseInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_moodlenet_get_shared_course_info_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get information about an course being shared

        Get information about an course being shared

        :param courseid: The course id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_get_shared_course_info_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetGetSharedCourseInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_moodlenet_get_shared_course_info_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_moodlenet_get_shared_course_info'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_moodlenet_get_shared_course_info'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_moodlenet_get_shared_course_info',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_moodlenet_send_activity_args(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="Course module ID")],
        issuerid: Annotated[Optional[StrictInt], Field(description="OAuth 2 issuer ID")],
        shareformat: Annotated[Optional[StrictInt], Field(description="Share format")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Send activity to MoodleNet

        Send activity to MoodleNet

        :param cmid: Course module ID (required)
        :type cmid: int
        :param issuerid: OAuth 2 issuer ID (required)
        :type issuerid: int
        :param shareformat: Share format (required)
        :type shareformat: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_send_activity_serialize(
            cmid=cmid,
            issuerid=issuerid,
            shareformat=shareformat,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetSendActivityResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_moodlenet_send_activity(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="Course module ID")],
        issuerid: Annotated[Optional[StrictInt], Field(description="OAuth 2 issuer ID")],
        shareformat: Annotated[Optional[StrictInt], Field(description="Share format")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMoodlenetSendActivityResponse:
        """Send activity to MoodleNet

        Send activity to MoodleNet

        :param cmid: Course module ID (required)
        :type cmid: int
        :param issuerid: OAuth 2 issuer ID (required)
        :type issuerid: int
        :param shareformat: Share format (required)
        :type shareformat: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_send_activity_serialize(
            cmid=cmid,
            issuerid=issuerid,
            shareformat=shareformat,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetSendActivityResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_moodlenet_send_activity_from_args(
        self,
        args
    ) -> CoreMoodlenetSendActivityResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetSendActivityResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_moodlenet_send_activity_with_http_info(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="Course module ID")],
        issuerid: Annotated[Optional[StrictInt], Field(description="OAuth 2 issuer ID")],
        shareformat: Annotated[Optional[StrictInt], Field(description="Share format")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMoodlenetSendActivityResponse]:
        """Send activity to MoodleNet

        Send activity to MoodleNet

        :param cmid: Course module ID (required)
        :type cmid: int
        :param issuerid: OAuth 2 issuer ID (required)
        :type issuerid: int
        :param shareformat: Share format (required)
        :type shareformat: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_send_activity_serialize(
            cmid=cmid,
            issuerid=issuerid,
            shareformat=shareformat,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetSendActivityResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_moodlenet_send_activity_without_preload_content(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="Course module ID")],
        issuerid: Annotated[Optional[StrictInt], Field(description="OAuth 2 issuer ID")],
        shareformat: Annotated[Optional[StrictInt], Field(description="Share format")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Send activity to MoodleNet

        Send activity to MoodleNet

        :param cmid: Course module ID (required)
        :type cmid: int
        :param issuerid: OAuth 2 issuer ID (required)
        :type issuerid: int
        :param shareformat: Share format (required)
        :type shareformat: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_send_activity_serialize(
            cmid=cmid,
            issuerid=issuerid,
            shareformat=shareformat,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetSendActivityResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_moodlenet_send_activity_serialize(
        self,
        cmid,
        issuerid,
        shareformat,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_moodlenet_send_activity'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_moodlenet_send_activity'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_moodlenet_send_activity',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        if issuerid is not None:
            _form_params += parse_form({'issuerid': issuerid})
        if shareformat is not None:
            _form_params += parse_form({'shareformat': shareformat})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_moodlenet_send_course_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        issuerid: Annotated[Optional[StrictInt], Field(description="OAuth 2 issuer ID")],
        shareformat: Annotated[Optional[StrictInt], Field(description="Share format")],
        cmids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="List for course module ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Send course to MoodleNet

        Send course to MoodleNet

        :param courseid: Course ID (required)
        :type courseid: int
        :param issuerid: OAuth 2 issuer ID (required)
        :type issuerid: int
        :param shareformat: Share format (required)
        :type shareformat: int
        :param cmids: List for course module ids
        :type cmids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_send_course_serialize(
            courseid=courseid,
            issuerid=issuerid,
            shareformat=shareformat,
            cmids=cmids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetSendCourseResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_moodlenet_send_course(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        issuerid: Annotated[Optional[StrictInt], Field(description="OAuth 2 issuer ID")],
        shareformat: Annotated[Optional[StrictInt], Field(description="Share format")],
        cmids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="List for course module ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMoodlenetSendCourseResponse:
        """Send course to MoodleNet

        Send course to MoodleNet

        :param courseid: Course ID (required)
        :type courseid: int
        :param issuerid: OAuth 2 issuer ID (required)
        :type issuerid: int
        :param shareformat: Share format (required)
        :type shareformat: int
        :param cmids: List for course module ids
        :type cmids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_send_course_serialize(
            courseid=courseid,
            issuerid=issuerid,
            shareformat=shareformat,
            cmids=cmids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetSendCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_moodlenet_send_course_from_args(
        self,
        args
    ) -> CoreMoodlenetSendCourseResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetSendCourseResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_moodlenet_send_course_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        issuerid: Annotated[Optional[StrictInt], Field(description="OAuth 2 issuer ID")],
        shareformat: Annotated[Optional[StrictInt], Field(description="Share format")],
        cmids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="List for course module ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMoodlenetSendCourseResponse]:
        """Send course to MoodleNet

        Send course to MoodleNet

        :param courseid: Course ID (required)
        :type courseid: int
        :param issuerid: OAuth 2 issuer ID (required)
        :type issuerid: int
        :param shareformat: Share format (required)
        :type shareformat: int
        :param cmids: List for course module ids
        :type cmids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_send_course_serialize(
            courseid=courseid,
            issuerid=issuerid,
            shareformat=shareformat,
            cmids=cmids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetSendCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_moodlenet_send_course_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        issuerid: Annotated[Optional[StrictInt], Field(description="OAuth 2 issuer ID")],
        shareformat: Annotated[Optional[StrictInt], Field(description="Share format")],
        cmids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="List for course module ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Send course to MoodleNet

        Send course to MoodleNet

        :param courseid: Course ID (required)
        :type courseid: int
        :param issuerid: OAuth 2 issuer ID (required)
        :type issuerid: int
        :param shareformat: Share format (required)
        :type shareformat: int
        :param cmids: List for course module ids
        :type cmids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_moodlenet_send_course_serialize(
            courseid=courseid,
            issuerid=issuerid,
            shareformat=shareformat,
            cmids=cmids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMoodlenetSendCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_moodlenet_send_course_serialize(
        self,
        courseid,
        issuerid,
        shareformat,
        cmids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'cmids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_moodlenet_send_course'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_moodlenet_send_course'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_moodlenet_send_course',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmids is not None:
            _form_params += parse_form({'cmids': cmids})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if issuerid is not None:
            _form_params += parse_form({'issuerid': issuerid})
        if shareformat is not None:
            _form_params += parse_form({'shareformat': shareformat})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_my_view_page_args(
        self,
        page: Annotated[Optional[StrictStr], Field(description="My page to trigger a view event")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the My or Dashboard viewed event.

        Trigger the My or Dashboard viewed event.

        :param page: My page to trigger a view event (required)
        :type page: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_my_view_page_serialize(
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMyViewPageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_my_view_page(
        self,
        page: Annotated[Optional[StrictStr], Field(description="My page to trigger a view event")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreMyViewPageResponse:
        """Trigger the My or Dashboard viewed event.

        Trigger the My or Dashboard viewed event.

        :param page: My page to trigger a view event (required)
        :type page: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_my_view_page_serialize(
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMyViewPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_my_view_page_from_args(
        self,
        args
    ) -> CoreMyViewPageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMyViewPageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_my_view_page_with_http_info(
        self,
        page: Annotated[Optional[StrictStr], Field(description="My page to trigger a view event")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreMyViewPageResponse]:
        """Trigger the My or Dashboard viewed event.

        Trigger the My or Dashboard viewed event.

        :param page: My page to trigger a view event (required)
        :type page: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_my_view_page_serialize(
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMyViewPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_my_view_page_without_preload_content(
        self,
        page: Annotated[Optional[StrictStr], Field(description="My page to trigger a view event")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the My or Dashboard viewed event.

        Trigger the My or Dashboard viewed event.

        :param page: My page to trigger a view event (required)
        :type page: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_my_view_page_serialize(
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreMyViewPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_my_view_page_serialize(
        self,
        page,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_my_view_page'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_my_view_page'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_my_view_page',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if page is not None:
            _form_params += parse_form({'page': page})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_notes_create_notes_args(
        self,
        notes: List[CoreNotesCreateNotesParametersNotesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Create notes

        Create notes

        :param notes: (required)
        :type notes: List[CoreNotesCreateNotesParametersNotesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_create_notes_serialize(
            notes=notes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreNotesCreateNotesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_notes_create_notes(
        self,
        notes: List[CoreNotesCreateNotesParametersNotesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreNotesCreateNotesResponseInner]:
        """Create notes

        Create notes

        :param notes: (required)
        :type notes: List[CoreNotesCreateNotesParametersNotesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_create_notes_serialize(
            notes=notes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreNotesCreateNotesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_notes_create_notes_from_args(
        self,
        args
    ) -> List[CoreNotesCreateNotesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreNotesCreateNotesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_notes_create_notes_with_http_info(
        self,
        notes: List[CoreNotesCreateNotesParametersNotesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreNotesCreateNotesResponseInner]]:
        """Create notes

        Create notes

        :param notes: (required)
        :type notes: List[CoreNotesCreateNotesParametersNotesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_create_notes_serialize(
            notes=notes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreNotesCreateNotesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_notes_create_notes_without_preload_content(
        self,
        notes: List[CoreNotesCreateNotesParametersNotesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create notes

        Create notes

        :param notes: (required)
        :type notes: List[CoreNotesCreateNotesParametersNotesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_create_notes_serialize(
            notes=notes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreNotesCreateNotesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_notes_create_notes_serialize(
        self,
        notes,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'notes': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_notes_create_notes'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_notes_create_notes'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_notes_create_notes',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if notes is not None:
            _form_params += parse_form({'notes': notes})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_notes_delete_notes_args(
        self,
        notes: Annotated[List[Optional[StrictInt]], Field(description="Array of Note Ids to be deleted.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete notes

        Delete notes

        :param notes: Array of Note Ids to be deleted. (required)
        :type notes: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_delete_notes_serialize(
            notes=notes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreNotesDeleteNotesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_notes_delete_notes(
        self,
        notes: Annotated[List[Optional[StrictInt]], Field(description="Array of Note Ids to be deleted.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreNotesDeleteNotesResponseInner]:
        """Delete notes

        Delete notes

        :param notes: Array of Note Ids to be deleted. (required)
        :type notes: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_delete_notes_serialize(
            notes=notes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreNotesDeleteNotesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_notes_delete_notes_from_args(
        self,
        args
    ) -> List[CoreNotesDeleteNotesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreNotesDeleteNotesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_notes_delete_notes_with_http_info(
        self,
        notes: Annotated[List[Optional[StrictInt]], Field(description="Array of Note Ids to be deleted.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreNotesDeleteNotesResponseInner]]:
        """Delete notes

        Delete notes

        :param notes: Array of Note Ids to be deleted. (required)
        :type notes: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_delete_notes_serialize(
            notes=notes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreNotesDeleteNotesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_notes_delete_notes_without_preload_content(
        self,
        notes: Annotated[List[Optional[StrictInt]], Field(description="Array of Note Ids to be deleted.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete notes

        Delete notes

        :param notes: Array of Note Ids to be deleted. (required)
        :type notes: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_delete_notes_serialize(
            notes=notes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreNotesDeleteNotesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_notes_delete_notes_serialize(
        self,
        notes,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'notes': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_notes_delete_notes'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_notes_delete_notes'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_notes_delete_notes',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if notes is not None:
            _form_params += parse_form({'notes': notes})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_notes_get_course_notes_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id, 0 for SITE")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns all notes in specified course (or site), for the specified user.

        Returns all notes in specified course (or site), for the specified user.

        :param courseid: course id, 0 for SITE (required)
        :type courseid: int
        :param userid: user id
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_get_course_notes_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreNotesGetCourseNotesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_notes_get_course_notes(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id, 0 for SITE")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreNotesGetCourseNotesResponse:
        """Returns all notes in specified course (or site), for the specified user.

        Returns all notes in specified course (or site), for the specified user.

        :param courseid: course id, 0 for SITE (required)
        :type courseid: int
        :param userid: user id
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_get_course_notes_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreNotesGetCourseNotesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_notes_get_course_notes_from_args(
        self,
        args
    ) -> CoreNotesGetCourseNotesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreNotesGetCourseNotesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_notes_get_course_notes_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id, 0 for SITE")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreNotesGetCourseNotesResponse]:
        """Returns all notes in specified course (or site), for the specified user.

        Returns all notes in specified course (or site), for the specified user.

        :param courseid: course id, 0 for SITE (required)
        :type courseid: int
        :param userid: user id
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_get_course_notes_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreNotesGetCourseNotesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_notes_get_course_notes_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id, 0 for SITE")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns all notes in specified course (or site), for the specified user.

        Returns all notes in specified course (or site), for the specified user.

        :param courseid: course id, 0 for SITE (required)
        :type courseid: int
        :param userid: user id
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_get_course_notes_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreNotesGetCourseNotesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_notes_get_course_notes_serialize(
        self,
        courseid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_notes_get_course_notes'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_notes_get_course_notes'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_notes_get_course_notes',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_notes_get_notes_args(
        self,
        notes: Annotated[List[Optional[StrictInt]], Field(description="Array of Note Ids to be retrieved.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get notes

        Get notes

        :param notes: Array of Note Ids to be retrieved. (required)
        :type notes: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_get_notes_serialize(
            notes=notes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreNotesGetNotesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_notes_get_notes(
        self,
        notes: Annotated[List[Optional[StrictInt]], Field(description="Array of Note Ids to be retrieved.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreNotesGetNotesResponse:
        """Get notes

        Get notes

        :param notes: Array of Note Ids to be retrieved. (required)
        :type notes: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_get_notes_serialize(
            notes=notes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreNotesGetNotesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_notes_get_notes_from_args(
        self,
        args
    ) -> CoreNotesGetNotesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreNotesGetNotesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_notes_get_notes_with_http_info(
        self,
        notes: Annotated[List[Optional[StrictInt]], Field(description="Array of Note Ids to be retrieved.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreNotesGetNotesResponse]:
        """Get notes

        Get notes

        :param notes: Array of Note Ids to be retrieved. (required)
        :type notes: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_get_notes_serialize(
            notes=notes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreNotesGetNotesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_notes_get_notes_without_preload_content(
        self,
        notes: Annotated[List[Optional[StrictInt]], Field(description="Array of Note Ids to be retrieved.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get notes

        Get notes

        :param notes: Array of Note Ids to be retrieved. (required)
        :type notes: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_get_notes_serialize(
            notes=notes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreNotesGetNotesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_notes_get_notes_serialize(
        self,
        notes,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'notes': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_notes_get_notes'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_notes_get_notes'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_notes_get_notes',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if notes is not None:
            _form_params += parse_form({'notes': notes})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_notes_update_notes_args(
        self,
        notes: Annotated[Optional[List[CoreNotesUpdateNotesParametersNotesInner]], Field(description="Array of Notes")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update notes

        Update notes

        :param notes: Array of Notes
        :type notes: List[CoreNotesUpdateNotesParametersNotesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_update_notes_serialize(
            notes=notes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreNotesDeleteNotesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_notes_update_notes(
        self,
        notes: Annotated[Optional[List[CoreNotesUpdateNotesParametersNotesInner]], Field(description="Array of Notes")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreNotesDeleteNotesResponseInner]:
        """Update notes

        Update notes

        :param notes: Array of Notes
        :type notes: List[CoreNotesUpdateNotesParametersNotesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_update_notes_serialize(
            notes=notes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreNotesDeleteNotesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_notes_update_notes_from_args(
        self,
        args
    ) -> List[CoreNotesDeleteNotesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreNotesDeleteNotesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_notes_update_notes_with_http_info(
        self,
        notes: Annotated[Optional[List[CoreNotesUpdateNotesParametersNotesInner]], Field(description="Array of Notes")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreNotesDeleteNotesResponseInner]]:
        """Update notes

        Update notes

        :param notes: Array of Notes
        :type notes: List[CoreNotesUpdateNotesParametersNotesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_update_notes_serialize(
            notes=notes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreNotesDeleteNotesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_notes_update_notes_without_preload_content(
        self,
        notes: Annotated[Optional[List[CoreNotesUpdateNotesParametersNotesInner]], Field(description="Array of Notes")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update notes

        Update notes

        :param notes: Array of Notes
        :type notes: List[CoreNotesUpdateNotesParametersNotesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_update_notes_serialize(
            notes=notes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreNotesDeleteNotesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_notes_update_notes_serialize(
        self,
        notes,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'notes': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_notes_update_notes'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_notes_update_notes'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_notes_update_notes',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if notes is not None:
            _form_params += parse_form({'notes': notes})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_notes_view_notes_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id, 0 for notes at system level")],
        userid: Annotated[Optional[StrictInt], Field(description="user id, 0 means view all the user notes")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Simulates the web interface view of notes/index.php: trigger events.

        Simulates the web interface view of notes/index.php: trigger events.

        :param courseid: course id, 0 for notes at system level (required)
        :type courseid: int
        :param userid: user id, 0 means view all the user notes
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_view_notes_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreNotesViewNotesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_notes_view_notes(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id, 0 for notes at system level")],
        userid: Annotated[Optional[StrictInt], Field(description="user id, 0 means view all the user notes")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreNotesViewNotesResponse:
        """Simulates the web interface view of notes/index.php: trigger events.

        Simulates the web interface view of notes/index.php: trigger events.

        :param courseid: course id, 0 for notes at system level (required)
        :type courseid: int
        :param userid: user id, 0 means view all the user notes
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_view_notes_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreNotesViewNotesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_notes_view_notes_from_args(
        self,
        args
    ) -> CoreNotesViewNotesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreNotesViewNotesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_notes_view_notes_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id, 0 for notes at system level")],
        userid: Annotated[Optional[StrictInt], Field(description="user id, 0 means view all the user notes")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreNotesViewNotesResponse]:
        """Simulates the web interface view of notes/index.php: trigger events.

        Simulates the web interface view of notes/index.php: trigger events.

        :param courseid: course id, 0 for notes at system level (required)
        :type courseid: int
        :param userid: user id, 0 means view all the user notes
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_view_notes_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreNotesViewNotesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_notes_view_notes_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="course id, 0 for notes at system level")],
        userid: Annotated[Optional[StrictInt], Field(description="user id, 0 means view all the user notes")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Simulates the web interface view of notes/index.php: trigger events.

        Simulates the web interface view of notes/index.php: trigger events.

        :param courseid: course id, 0 for notes at system level (required)
        :type courseid: int
        :param userid: user id, 0 means view all the user notes
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_notes_view_notes_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreNotesViewNotesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_notes_view_notes_serialize(
        self,
        courseid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_notes_view_notes'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_notes_view_notes'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_notes_view_notes',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_output_load_fontawesome_icon_system_map_args(
        self,
        args: CoreOutputLoadFontawesomeIconSystemMapParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load the mapping of moodle pix names to fontawesome icon names

        Load the mapping of moodle pix names to fontawesome icon names

        :param args: (required)
        :type args: CoreOutputLoadFontawesomeIconSystemMapParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_output_load_fontawesome_icon_system_map_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreOutputLoadFontawesomeIconSystemMapResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_output_load_fontawesome_icon_system_map(
        self,
        args: CoreOutputLoadFontawesomeIconSystemMapParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreOutputLoadFontawesomeIconSystemMapResponseInner]:
        """Load the mapping of moodle pix names to fontawesome icon names

        Load the mapping of moodle pix names to fontawesome icon names

        :param args: (required)
        :type args: CoreOutputLoadFontawesomeIconSystemMapParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_output_load_fontawesome_icon_system_map_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreOutputLoadFontawesomeIconSystemMapResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_output_load_fontawesome_icon_system_map_from_args(
        self,
        args
    ) -> List[CoreOutputLoadFontawesomeIconSystemMapResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreOutputLoadFontawesomeIconSystemMapResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_output_load_fontawesome_icon_system_map_with_http_info(
        self,
        args: CoreOutputLoadFontawesomeIconSystemMapParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreOutputLoadFontawesomeIconSystemMapResponseInner]]:
        """Load the mapping of moodle pix names to fontawesome icon names

        Load the mapping of moodle pix names to fontawesome icon names

        :param args: (required)
        :type args: CoreOutputLoadFontawesomeIconSystemMapParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_output_load_fontawesome_icon_system_map_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreOutputLoadFontawesomeIconSystemMapResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_output_load_fontawesome_icon_system_map_without_preload_content(
        self,
        args: CoreOutputLoadFontawesomeIconSystemMapParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load the mapping of moodle pix names to fontawesome icon names

        Load the mapping of moodle pix names to fontawesome icon names

        :param args: (required)
        :type args: CoreOutputLoadFontawesomeIconSystemMapParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_output_load_fontawesome_icon_system_map_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreOutputLoadFontawesomeIconSystemMapResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_output_load_fontawesome_icon_system_map_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#core_output_load_fontawesome_icon_system_map'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_output_load_fontawesome_icon_system_map'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_output_load_fontawesome_icon_system_map',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_output_load_template_args(
        self,
        args: CoreOutputLoadTemplateParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load a template for a renderable

        Load a template for a renderable

        :param args: (required)
        :type args: CoreOutputLoadTemplateParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_output_load_template_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_output_load_template(
        self,
        args: CoreOutputLoadTemplateParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """Load a template for a renderable

        Load a template for a renderable

        :param args: (required)
        :type args: CoreOutputLoadTemplateParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_output_load_template_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_output_load_template_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_output_load_template_with_http_info(
        self,
        args: CoreOutputLoadTemplateParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """Load a template for a renderable

        Load a template for a renderable

        :param args: (required)
        :type args: CoreOutputLoadTemplateParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_output_load_template_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_output_load_template_without_preload_content(
        self,
        args: CoreOutputLoadTemplateParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load a template for a renderable

        Load a template for a renderable

        :param args: (required)
        :type args: CoreOutputLoadTemplateParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_output_load_template_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_output_load_template_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#core_output_load_template'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_output_load_template'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_output_load_template',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_output_load_template_with_dependencies_args(
        self,
        args: CoreOutputLoadTemplateWithDependenciesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load a template and its dependencies for a renderable

        Load a template and its dependencies for a renderable

        :param args: (required)
        :type args: CoreOutputLoadTemplateWithDependenciesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_output_load_template_with_dependencies_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreOutputLoadTemplateWithDependenciesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_output_load_template_with_dependencies(
        self,
        args: CoreOutputLoadTemplateWithDependenciesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreOutputLoadTemplateWithDependenciesResponse:
        """Load a template and its dependencies for a renderable

        Load a template and its dependencies for a renderable

        :param args: (required)
        :type args: CoreOutputLoadTemplateWithDependenciesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_output_load_template_with_dependencies_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreOutputLoadTemplateWithDependenciesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_output_load_template_with_dependencies_from_args(
        self,
        args
    ) -> CoreOutputLoadTemplateWithDependenciesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreOutputLoadTemplateWithDependenciesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_output_load_template_with_dependencies_with_http_info(
        self,
        args: CoreOutputLoadTemplateWithDependenciesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreOutputLoadTemplateWithDependenciesResponse]:
        """Load a template and its dependencies for a renderable

        Load a template and its dependencies for a renderable

        :param args: (required)
        :type args: CoreOutputLoadTemplateWithDependenciesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_output_load_template_with_dependencies_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreOutputLoadTemplateWithDependenciesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_output_load_template_with_dependencies_without_preload_content(
        self,
        args: CoreOutputLoadTemplateWithDependenciesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load a template and its dependencies for a renderable

        Load a template and its dependencies for a renderable

        :param args: (required)
        :type args: CoreOutputLoadTemplateWithDependenciesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_output_load_template_with_dependencies_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreOutputLoadTemplateWithDependenciesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_output_load_template_with_dependencies_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#core_output_load_template_with_dependencies'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_output_load_template_with_dependencies'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_output_load_template_with_dependencies',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_output_poll_stored_progress_args(
        self,
        ids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Polls for the current percentage progress of a stored progress object

        Polls for the current percentage progress of a stored progress object

        :param ids: (required)
        :type ids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_output_poll_stored_progress_serialize(
            ids=ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreOutputPollStoredProgressResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_output_poll_stored_progress(
        self,
        ids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreOutputPollStoredProgressResponseInner]:
        """Polls for the current percentage progress of a stored progress object

        Polls for the current percentage progress of a stored progress object

        :param ids: (required)
        :type ids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_output_poll_stored_progress_serialize(
            ids=ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreOutputPollStoredProgressResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_output_poll_stored_progress_from_args(
        self,
        args
    ) -> List[CoreOutputPollStoredProgressResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreOutputPollStoredProgressResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_output_poll_stored_progress_with_http_info(
        self,
        ids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreOutputPollStoredProgressResponseInner]]:
        """Polls for the current percentage progress of a stored progress object

        Polls for the current percentage progress of a stored progress object

        :param ids: (required)
        :type ids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_output_poll_stored_progress_serialize(
            ids=ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreOutputPollStoredProgressResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_output_poll_stored_progress_without_preload_content(
        self,
        ids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Polls for the current percentage progress of a stored progress object

        Polls for the current percentage progress of a stored progress object

        :param ids: (required)
        :type ids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_output_poll_stored_progress_serialize(
            ids=ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreOutputPollStoredProgressResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_output_poll_stored_progress_serialize(
        self,
        ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'ids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_output_poll_stored_progress'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_output_poll_stored_progress'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_output_poll_stored_progress',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if ids is not None:
            _form_params += parse_form({'ids': ids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_payment_get_available_gateways_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component")],
        itemid: Annotated[Optional[StrictInt], Field(description="An identifier for payment area in the component")],
        paymentarea: Annotated[Optional[StrictStr], Field(description="Payment area in the component")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the list of payment gateways that support the given component/area

        Get the list of payment gateways that support the given component/area

        :param component: Component (required)
        :type component: str
        :param itemid: An identifier for payment area in the component (required)
        :type itemid: int
        :param paymentarea: Payment area in the component (required)
        :type paymentarea: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_payment_get_available_gateways_serialize(
            component=component,
            itemid=itemid,
            paymentarea=paymentarea,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CorePaymentGetAvailableGatewaysResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_payment_get_available_gateways(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component")],
        itemid: Annotated[Optional[StrictInt], Field(description="An identifier for payment area in the component")],
        paymentarea: Annotated[Optional[StrictStr], Field(description="Payment area in the component")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CorePaymentGetAvailableGatewaysResponseInner]:
        """Get the list of payment gateways that support the given component/area

        Get the list of payment gateways that support the given component/area

        :param component: Component (required)
        :type component: str
        :param itemid: An identifier for payment area in the component (required)
        :type itemid: int
        :param paymentarea: Payment area in the component (required)
        :type paymentarea: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_payment_get_available_gateways_serialize(
            component=component,
            itemid=itemid,
            paymentarea=paymentarea,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CorePaymentGetAvailableGatewaysResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_payment_get_available_gateways_from_args(
        self,
        args
    ) -> List[CorePaymentGetAvailableGatewaysResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CorePaymentGetAvailableGatewaysResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_payment_get_available_gateways_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component")],
        itemid: Annotated[Optional[StrictInt], Field(description="An identifier for payment area in the component")],
        paymentarea: Annotated[Optional[StrictStr], Field(description="Payment area in the component")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CorePaymentGetAvailableGatewaysResponseInner]]:
        """Get the list of payment gateways that support the given component/area

        Get the list of payment gateways that support the given component/area

        :param component: Component (required)
        :type component: str
        :param itemid: An identifier for payment area in the component (required)
        :type itemid: int
        :param paymentarea: Payment area in the component (required)
        :type paymentarea: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_payment_get_available_gateways_serialize(
            component=component,
            itemid=itemid,
            paymentarea=paymentarea,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CorePaymentGetAvailableGatewaysResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_payment_get_available_gateways_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component")],
        itemid: Annotated[Optional[StrictInt], Field(description="An identifier for payment area in the component")],
        paymentarea: Annotated[Optional[StrictStr], Field(description="Payment area in the component")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the list of payment gateways that support the given component/area

        Get the list of payment gateways that support the given component/area

        :param component: Component (required)
        :type component: str
        :param itemid: An identifier for payment area in the component (required)
        :type itemid: int
        :param paymentarea: Payment area in the component (required)
        :type paymentarea: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_payment_get_available_gateways_serialize(
            component=component,
            itemid=itemid,
            paymentarea=paymentarea,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CorePaymentGetAvailableGatewaysResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_payment_get_available_gateways_serialize(
        self,
        component,
        itemid,
        paymentarea,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_payment_get_available_gateways'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_payment_get_available_gateways'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_payment_get_available_gateways',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if component is not None:
            _form_params += parse_form({'component': component})
        if itemid is not None:
            _form_params += parse_form({'itemid': itemid})
        if paymentarea is not None:
            _form_params += parse_form({'paymentarea': paymentarea})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_question_get_random_question_summaries_args(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="Category id to find random questions")],
        contextid: Annotated[Optional[StrictInt], Field(description="Context id that the questions will be rendered in (used for exporting)")],
        includesubcategories: Annotated[Optional[StrictBool], Field(description="Include the subcategories in the search")],
        tagids: List[Optional[StrictInt]],
        limit: Annotated[Optional[StrictInt], Field(description="Maximum number of results to return")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Number of items to skip from the begging of the result set")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the random question set for a criteria

        Get the random question set for a criteria

        :param categoryid: Category id to find random questions (required)
        :type categoryid: int
        :param contextid: Context id that the questions will be rendered in (used for exporting) (required)
        :type contextid: int
        :param includesubcategories: Include the subcategories in the search (required)
        :type includesubcategories: bool
        :param tagids: (required)
        :type tagids: List[Optional[int]]
        :param limit: Maximum number of results to return
        :type limit: int
        :param offset: Number of items to skip from the begging of the result set
        :type offset: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_question_get_random_question_summaries_serialize(
            categoryid=categoryid,
            contextid=contextid,
            includesubcategories=includesubcategories,
            tagids=tagids,
            limit=limit,
            offset=offset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreQuestionGetRandomQuestionSummariesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_question_get_random_question_summaries(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="Category id to find random questions")],
        contextid: Annotated[Optional[StrictInt], Field(description="Context id that the questions will be rendered in (used for exporting)")],
        includesubcategories: Annotated[Optional[StrictBool], Field(description="Include the subcategories in the search")],
        tagids: List[Optional[StrictInt]],
        limit: Annotated[Optional[StrictInt], Field(description="Maximum number of results to return")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Number of items to skip from the begging of the result set")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreQuestionGetRandomQuestionSummariesResponse:
        """Get the random question set for a criteria

        Get the random question set for a criteria

        :param categoryid: Category id to find random questions (required)
        :type categoryid: int
        :param contextid: Context id that the questions will be rendered in (used for exporting) (required)
        :type contextid: int
        :param includesubcategories: Include the subcategories in the search (required)
        :type includesubcategories: bool
        :param tagids: (required)
        :type tagids: List[Optional[int]]
        :param limit: Maximum number of results to return
        :type limit: int
        :param offset: Number of items to skip from the begging of the result set
        :type offset: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_question_get_random_question_summaries_serialize(
            categoryid=categoryid,
            contextid=contextid,
            includesubcategories=includesubcategories,
            tagids=tagids,
            limit=limit,
            offset=offset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreQuestionGetRandomQuestionSummariesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_question_get_random_question_summaries_from_args(
        self,
        args
    ) -> CoreQuestionGetRandomQuestionSummariesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreQuestionGetRandomQuestionSummariesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_question_get_random_question_summaries_with_http_info(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="Category id to find random questions")],
        contextid: Annotated[Optional[StrictInt], Field(description="Context id that the questions will be rendered in (used for exporting)")],
        includesubcategories: Annotated[Optional[StrictBool], Field(description="Include the subcategories in the search")],
        tagids: List[Optional[StrictInt]],
        limit: Annotated[Optional[StrictInt], Field(description="Maximum number of results to return")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Number of items to skip from the begging of the result set")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreQuestionGetRandomQuestionSummariesResponse]:
        """Get the random question set for a criteria

        Get the random question set for a criteria

        :param categoryid: Category id to find random questions (required)
        :type categoryid: int
        :param contextid: Context id that the questions will be rendered in (used for exporting) (required)
        :type contextid: int
        :param includesubcategories: Include the subcategories in the search (required)
        :type includesubcategories: bool
        :param tagids: (required)
        :type tagids: List[Optional[int]]
        :param limit: Maximum number of results to return
        :type limit: int
        :param offset: Number of items to skip from the begging of the result set
        :type offset: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_question_get_random_question_summaries_serialize(
            categoryid=categoryid,
            contextid=contextid,
            includesubcategories=includesubcategories,
            tagids=tagids,
            limit=limit,
            offset=offset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreQuestionGetRandomQuestionSummariesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_question_get_random_question_summaries_without_preload_content(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="Category id to find random questions")],
        contextid: Annotated[Optional[StrictInt], Field(description="Context id that the questions will be rendered in (used for exporting)")],
        includesubcategories: Annotated[Optional[StrictBool], Field(description="Include the subcategories in the search")],
        tagids: List[Optional[StrictInt]],
        limit: Annotated[Optional[StrictInt], Field(description="Maximum number of results to return")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Number of items to skip from the begging of the result set")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the random question set for a criteria

        Get the random question set for a criteria

        :param categoryid: Category id to find random questions (required)
        :type categoryid: int
        :param contextid: Context id that the questions will be rendered in (used for exporting) (required)
        :type contextid: int
        :param includesubcategories: Include the subcategories in the search (required)
        :type includesubcategories: bool
        :param tagids: (required)
        :type tagids: List[Optional[int]]
        :param limit: Maximum number of results to return
        :type limit: int
        :param offset: Number of items to skip from the begging of the result set
        :type offset: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_question_get_random_question_summaries_serialize(
            categoryid=categoryid,
            contextid=contextid,
            includesubcategories=includesubcategories,
            tagids=tagids,
            limit=limit,
            offset=offset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreQuestionGetRandomQuestionSummariesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_question_get_random_question_summaries_serialize(
        self,
        categoryid,
        contextid,
        includesubcategories,
        tagids,
        limit,
        offset,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'tagids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_question_get_random_question_summaries'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_question_get_random_question_summaries'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_question_get_random_question_summaries',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if categoryid is not None:
            _form_params += parse_form({'categoryid': categoryid})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if includesubcategories is not None:
            _form_params += parse_form({'includesubcategories': includesubcategories})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if offset is not None:
            _form_params += parse_form({'offset': offset})
        if tagids is not None:
            _form_params += parse_form({'tagids': tagids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_question_move_questions_args(
        self,
        newcategoryid: Annotated[Optional[StrictInt], Field(description="ID of the target question category")],
        newcontextid: Annotated[Optional[StrictInt], Field(description="Contextid of the target question bank")],
        questionids: Annotated[Optional[StrictStr], Field(description="Comma separated list of question ids to move")],
        returnurl: Annotated[Optional[StrictStr], Field(description="A URL to add/update the filter param with the new category")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Bulk move questions to a new category.

        Bulk move questions to a new category.

        :param newcategoryid: ID of the target question category (required)
        :type newcategoryid: int
        :param newcontextid: Contextid of the target question bank (required)
        :type newcontextid: int
        :param questionids: Comma separated list of question ids to move (required)
        :type questionids: str
        :param returnurl: A URL to add/update the filter param with the new category (required)
        :type returnurl: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_question_move_questions_serialize(
            newcategoryid=newcategoryid,
            newcontextid=newcontextid,
            questionids=questionids,
            returnurl=returnurl,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_question_move_questions(
        self,
        newcategoryid: Annotated[Optional[StrictInt], Field(description="ID of the target question category")],
        newcontextid: Annotated[Optional[StrictInt], Field(description="Contextid of the target question bank")],
        questionids: Annotated[Optional[StrictStr], Field(description="Comma separated list of question ids to move")],
        returnurl: Annotated[Optional[StrictStr], Field(description="A URL to add/update the filter param with the new category")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """Bulk move questions to a new category.

        Bulk move questions to a new category.

        :param newcategoryid: ID of the target question category (required)
        :type newcategoryid: int
        :param newcontextid: Contextid of the target question bank (required)
        :type newcontextid: int
        :param questionids: Comma separated list of question ids to move (required)
        :type questionids: str
        :param returnurl: A URL to add/update the filter param with the new category (required)
        :type returnurl: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_question_move_questions_serialize(
            newcategoryid=newcategoryid,
            newcontextid=newcontextid,
            questionids=questionids,
            returnurl=returnurl,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_question_move_questions_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_question_move_questions_with_http_info(
        self,
        newcategoryid: Annotated[Optional[StrictInt], Field(description="ID of the target question category")],
        newcontextid: Annotated[Optional[StrictInt], Field(description="Contextid of the target question bank")],
        questionids: Annotated[Optional[StrictStr], Field(description="Comma separated list of question ids to move")],
        returnurl: Annotated[Optional[StrictStr], Field(description="A URL to add/update the filter param with the new category")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """Bulk move questions to a new category.

        Bulk move questions to a new category.

        :param newcategoryid: ID of the target question category (required)
        :type newcategoryid: int
        :param newcontextid: Contextid of the target question bank (required)
        :type newcontextid: int
        :param questionids: Comma separated list of question ids to move (required)
        :type questionids: str
        :param returnurl: A URL to add/update the filter param with the new category (required)
        :type returnurl: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_question_move_questions_serialize(
            newcategoryid=newcategoryid,
            newcontextid=newcontextid,
            questionids=questionids,
            returnurl=returnurl,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_question_move_questions_without_preload_content(
        self,
        newcategoryid: Annotated[Optional[StrictInt], Field(description="ID of the target question category")],
        newcontextid: Annotated[Optional[StrictInt], Field(description="Contextid of the target question bank")],
        questionids: Annotated[Optional[StrictStr], Field(description="Comma separated list of question ids to move")],
        returnurl: Annotated[Optional[StrictStr], Field(description="A URL to add/update the filter param with the new category")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Bulk move questions to a new category.

        Bulk move questions to a new category.

        :param newcategoryid: ID of the target question category (required)
        :type newcategoryid: int
        :param newcontextid: Contextid of the target question bank (required)
        :type newcontextid: int
        :param questionids: Comma separated list of question ids to move (required)
        :type questionids: str
        :param returnurl: A URL to add/update the filter param with the new category (required)
        :type returnurl: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_question_move_questions_serialize(
            newcategoryid=newcategoryid,
            newcontextid=newcontextid,
            questionids=questionids,
            returnurl=returnurl,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_question_move_questions_serialize(
        self,
        newcategoryid,
        newcontextid,
        questionids,
        returnurl,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_question_move_questions'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_question_move_questions'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_question_move_questions',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if newcategoryid is not None:
            _form_params += parse_form({'newcategoryid': newcategoryid})
        if newcontextid is not None:
            _form_params += parse_form({'newcontextid': newcontextid})
        if questionids is not None:
            _form_params += parse_form({'questionids': questionids})
        if returnurl is not None:
            _form_params += parse_form({'returnurl': returnurl})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_question_search_shared_banks_args(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The current context ID for applying text filters to bank names.")],
        search: Annotated[Optional[StrictStr], Field(description="Search terms by which to filter the shared banks.")],
        requiredcapabilities: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Array of abbreviated \\\"moodle/question:\\\" capabilities that the user must have at least one of in the context of each matching question bank. Valid options are \\\"add\\\", \\\"managecategory\\\", \\\"flag\\\", \\\"config\\\", \\\"edit\\\", \\\"view\\\", \\\"use\\\", \\\"move\\\" or \\\"tag\\\". For \\\"edit\\\", \\\"view\\\", \\\"use\\\", \\\"move\\\" and \\\"tag\\\", the -all and -mine suffixed versions of the capabilty will both be checked.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get a list of shared question banks filtered by a search term.

        Get a list of shared question banks filtered by a search term.

        :param contextid: The current context ID for applying text filters to bank names. (required)
        :type contextid: int
        :param search: Search terms by which to filter the shared banks. (required)
        :type search: str
        :param requiredcapabilities: Array of abbreviated \\\"moodle/question:\\\" capabilities that the user must have at least one of in the context of each matching question bank. Valid options are \\\"add\\\", \\\"managecategory\\\", \\\"flag\\\", \\\"config\\\", \\\"edit\\\", \\\"view\\\", \\\"use\\\", \\\"move\\\" or \\\"tag\\\". For \\\"edit\\\", \\\"view\\\", \\\"use\\\", \\\"move\\\" and \\\"tag\\\", the -all and -mine suffixed versions of the capabilty will both be checked.
        :type requiredcapabilities: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_question_search_shared_banks_serialize(
            contextid=contextid,
            search=search,
            requiredcapabilities=requiredcapabilities,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreQuestionSearchSharedBanksResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_question_search_shared_banks(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The current context ID for applying text filters to bank names.")],
        search: Annotated[Optional[StrictStr], Field(description="Search terms by which to filter the shared banks.")],
        requiredcapabilities: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Array of abbreviated \\\"moodle/question:\\\" capabilities that the user must have at least one of in the context of each matching question bank. Valid options are \\\"add\\\", \\\"managecategory\\\", \\\"flag\\\", \\\"config\\\", \\\"edit\\\", \\\"view\\\", \\\"use\\\", \\\"move\\\" or \\\"tag\\\". For \\\"edit\\\", \\\"view\\\", \\\"use\\\", \\\"move\\\" and \\\"tag\\\", the -all and -mine suffixed versions of the capabilty will both be checked.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreQuestionSearchSharedBanksResponse:
        """Get a list of shared question banks filtered by a search term.

        Get a list of shared question banks filtered by a search term.

        :param contextid: The current context ID for applying text filters to bank names. (required)
        :type contextid: int
        :param search: Search terms by which to filter the shared banks. (required)
        :type search: str
        :param requiredcapabilities: Array of abbreviated \\\"moodle/question:\\\" capabilities that the user must have at least one of in the context of each matching question bank. Valid options are \\\"add\\\", \\\"managecategory\\\", \\\"flag\\\", \\\"config\\\", \\\"edit\\\", \\\"view\\\", \\\"use\\\", \\\"move\\\" or \\\"tag\\\". For \\\"edit\\\", \\\"view\\\", \\\"use\\\", \\\"move\\\" and \\\"tag\\\", the -all and -mine suffixed versions of the capabilty will both be checked.
        :type requiredcapabilities: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_question_search_shared_banks_serialize(
            contextid=contextid,
            search=search,
            requiredcapabilities=requiredcapabilities,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreQuestionSearchSharedBanksResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_question_search_shared_banks_from_args(
        self,
        args
    ) -> CoreQuestionSearchSharedBanksResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreQuestionSearchSharedBanksResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_question_search_shared_banks_with_http_info(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The current context ID for applying text filters to bank names.")],
        search: Annotated[Optional[StrictStr], Field(description="Search terms by which to filter the shared banks.")],
        requiredcapabilities: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Array of abbreviated \\\"moodle/question:\\\" capabilities that the user must have at least one of in the context of each matching question bank. Valid options are \\\"add\\\", \\\"managecategory\\\", \\\"flag\\\", \\\"config\\\", \\\"edit\\\", \\\"view\\\", \\\"use\\\", \\\"move\\\" or \\\"tag\\\". For \\\"edit\\\", \\\"view\\\", \\\"use\\\", \\\"move\\\" and \\\"tag\\\", the -all and -mine suffixed versions of the capabilty will both be checked.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreQuestionSearchSharedBanksResponse]:
        """Get a list of shared question banks filtered by a search term.

        Get a list of shared question banks filtered by a search term.

        :param contextid: The current context ID for applying text filters to bank names. (required)
        :type contextid: int
        :param search: Search terms by which to filter the shared banks. (required)
        :type search: str
        :param requiredcapabilities: Array of abbreviated \\\"moodle/question:\\\" capabilities that the user must have at least one of in the context of each matching question bank. Valid options are \\\"add\\\", \\\"managecategory\\\", \\\"flag\\\", \\\"config\\\", \\\"edit\\\", \\\"view\\\", \\\"use\\\", \\\"move\\\" or \\\"tag\\\". For \\\"edit\\\", \\\"view\\\", \\\"use\\\", \\\"move\\\" and \\\"tag\\\", the -all and -mine suffixed versions of the capabilty will both be checked.
        :type requiredcapabilities: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_question_search_shared_banks_serialize(
            contextid=contextid,
            search=search,
            requiredcapabilities=requiredcapabilities,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreQuestionSearchSharedBanksResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_question_search_shared_banks_without_preload_content(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The current context ID for applying text filters to bank names.")],
        search: Annotated[Optional[StrictStr], Field(description="Search terms by which to filter the shared banks.")],
        requiredcapabilities: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Array of abbreviated \\\"moodle/question:\\\" capabilities that the user must have at least one of in the context of each matching question bank. Valid options are \\\"add\\\", \\\"managecategory\\\", \\\"flag\\\", \\\"config\\\", \\\"edit\\\", \\\"view\\\", \\\"use\\\", \\\"move\\\" or \\\"tag\\\". For \\\"edit\\\", \\\"view\\\", \\\"use\\\", \\\"move\\\" and \\\"tag\\\", the -all and -mine suffixed versions of the capabilty will both be checked.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get a list of shared question banks filtered by a search term.

        Get a list of shared question banks filtered by a search term.

        :param contextid: The current context ID for applying text filters to bank names. (required)
        :type contextid: int
        :param search: Search terms by which to filter the shared banks. (required)
        :type search: str
        :param requiredcapabilities: Array of abbreviated \\\"moodle/question:\\\" capabilities that the user must have at least one of in the context of each matching question bank. Valid options are \\\"add\\\", \\\"managecategory\\\", \\\"flag\\\", \\\"config\\\", \\\"edit\\\", \\\"view\\\", \\\"use\\\", \\\"move\\\" or \\\"tag\\\". For \\\"edit\\\", \\\"view\\\", \\\"use\\\", \\\"move\\\" and \\\"tag\\\", the -all and -mine suffixed versions of the capabilty will both be checked.
        :type requiredcapabilities: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_question_search_shared_banks_serialize(
            contextid=contextid,
            search=search,
            requiredcapabilities=requiredcapabilities,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreQuestionSearchSharedBanksResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_question_search_shared_banks_serialize(
        self,
        contextid,
        search,
        requiredcapabilities,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'requiredcapabilities': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_question_search_shared_banks'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_question_search_shared_banks'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_question_search_shared_banks',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if requiredcapabilities is not None:
            _form_params += parse_form({'requiredcapabilities': requiredcapabilities})
        if search is not None:
            _form_params += parse_form({'search': search})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_question_update_flag_args(
        self,
        checksum: Annotated[Optional[StrictStr], Field(description="computed checksum with the last three arguments and                              the users username")],
        newstate: Annotated[Optional[StrictBool], Field(description="the new state of the flag. true = flagged")],
        qaid: Annotated[Optional[StrictInt], Field(description="the question_attempt id")],
        qubaid: Annotated[Optional[StrictInt], Field(description="the question usage id.")],
        questionid: Annotated[Optional[StrictInt], Field(description="the question id")],
        slot: Annotated[Optional[StrictInt], Field(description="the slot number within the usage")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update the flag state of a question attempt.

        Update the flag state of a question attempt.

        :param checksum: computed checksum with the last three arguments and                              the users username (required)
        :type checksum: str
        :param newstate: the new state of the flag. true = flagged (required)
        :type newstate: bool
        :param qaid: the question_attempt id (required)
        :type qaid: int
        :param qubaid: the question usage id. (required)
        :type qubaid: int
        :param questionid: the question id (required)
        :type questionid: int
        :param slot: the slot number within the usage (required)
        :type slot: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_question_update_flag_serialize(
            checksum=checksum,
            newstate=newstate,
            qaid=qaid,
            qubaid=qubaid,
            questionid=questionid,
            slot=slot,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreQuestionUpdateFlagResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_question_update_flag(
        self,
        checksum: Annotated[Optional[StrictStr], Field(description="computed checksum with the last three arguments and                              the users username")],
        newstate: Annotated[Optional[StrictBool], Field(description="the new state of the flag. true = flagged")],
        qaid: Annotated[Optional[StrictInt], Field(description="the question_attempt id")],
        qubaid: Annotated[Optional[StrictInt], Field(description="the question usage id.")],
        questionid: Annotated[Optional[StrictInt], Field(description="the question id")],
        slot: Annotated[Optional[StrictInt], Field(description="the slot number within the usage")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreQuestionUpdateFlagResponse:
        """Update the flag state of a question attempt.

        Update the flag state of a question attempt.

        :param checksum: computed checksum with the last three arguments and                              the users username (required)
        :type checksum: str
        :param newstate: the new state of the flag. true = flagged (required)
        :type newstate: bool
        :param qaid: the question_attempt id (required)
        :type qaid: int
        :param qubaid: the question usage id. (required)
        :type qubaid: int
        :param questionid: the question id (required)
        :type questionid: int
        :param slot: the slot number within the usage (required)
        :type slot: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_question_update_flag_serialize(
            checksum=checksum,
            newstate=newstate,
            qaid=qaid,
            qubaid=qubaid,
            questionid=questionid,
            slot=slot,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreQuestionUpdateFlagResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_question_update_flag_from_args(
        self,
        args
    ) -> CoreQuestionUpdateFlagResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreQuestionUpdateFlagResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_question_update_flag_with_http_info(
        self,
        checksum: Annotated[Optional[StrictStr], Field(description="computed checksum with the last three arguments and                              the users username")],
        newstate: Annotated[Optional[StrictBool], Field(description="the new state of the flag. true = flagged")],
        qaid: Annotated[Optional[StrictInt], Field(description="the question_attempt id")],
        qubaid: Annotated[Optional[StrictInt], Field(description="the question usage id.")],
        questionid: Annotated[Optional[StrictInt], Field(description="the question id")],
        slot: Annotated[Optional[StrictInt], Field(description="the slot number within the usage")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreQuestionUpdateFlagResponse]:
        """Update the flag state of a question attempt.

        Update the flag state of a question attempt.

        :param checksum: computed checksum with the last three arguments and                              the users username (required)
        :type checksum: str
        :param newstate: the new state of the flag. true = flagged (required)
        :type newstate: bool
        :param qaid: the question_attempt id (required)
        :type qaid: int
        :param qubaid: the question usage id. (required)
        :type qubaid: int
        :param questionid: the question id (required)
        :type questionid: int
        :param slot: the slot number within the usage (required)
        :type slot: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_question_update_flag_serialize(
            checksum=checksum,
            newstate=newstate,
            qaid=qaid,
            qubaid=qubaid,
            questionid=questionid,
            slot=slot,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreQuestionUpdateFlagResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_question_update_flag_without_preload_content(
        self,
        checksum: Annotated[Optional[StrictStr], Field(description="computed checksum with the last three arguments and                              the users username")],
        newstate: Annotated[Optional[StrictBool], Field(description="the new state of the flag. true = flagged")],
        qaid: Annotated[Optional[StrictInt], Field(description="the question_attempt id")],
        qubaid: Annotated[Optional[StrictInt], Field(description="the question usage id.")],
        questionid: Annotated[Optional[StrictInt], Field(description="the question id")],
        slot: Annotated[Optional[StrictInt], Field(description="the slot number within the usage")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update the flag state of a question attempt.

        Update the flag state of a question attempt.

        :param checksum: computed checksum with the last three arguments and                              the users username (required)
        :type checksum: str
        :param newstate: the new state of the flag. true = flagged (required)
        :type newstate: bool
        :param qaid: the question_attempt id (required)
        :type qaid: int
        :param qubaid: the question usage id. (required)
        :type qubaid: int
        :param questionid: the question id (required)
        :type questionid: int
        :param slot: the slot number within the usage (required)
        :type slot: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_question_update_flag_serialize(
            checksum=checksum,
            newstate=newstate,
            qaid=qaid,
            qubaid=qubaid,
            questionid=questionid,
            slot=slot,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreQuestionUpdateFlagResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_question_update_flag_serialize(
        self,
        checksum,
        newstate,
        qaid,
        qubaid,
        questionid,
        slot,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_question_update_flag'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_question_update_flag'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_question_update_flag',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if checksum is not None:
            _form_params += parse_form({'checksum': checksum})
        if newstate is not None:
            _form_params += parse_form({'newstate': newstate})
        if qaid is not None:
            _form_params += parse_form({'qaid': qaid})
        if qubaid is not None:
            _form_params += parse_form({'qubaid': qubaid})
        if questionid is not None:
            _form_params += parse_form({'questionid': questionid})
        if slot is not None:
            _form_params += parse_form({'slot': slot})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_rating_add_rating_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        contextlevel: Annotated[Optional[StrictStr], Field(description="context level: course, module, user, etc...")],
        instanceid: Annotated[Optional[StrictInt], Field(description="the instance id of item associated with the context level")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        rateduserid: Annotated[Optional[StrictInt], Field(description="rated user id")],
        rating: Annotated[Optional[StrictInt], Field(description="user rating")],
        ratingarea: Annotated[Optional[StrictStr], Field(description="rating area")],
        scaleid: Annotated[Optional[StrictInt], Field(description="scale id")],
        aggregation: Annotated[Optional[StrictInt], Field(description="agreggation method")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Rates an item.

        Rates an item.

        :param component: component (required)
        :type component: str
        :param contextlevel: context level: course, module, user, etc... (required)
        :type contextlevel: str
        :param instanceid: the instance id of item associated with the context level (required)
        :type instanceid: int
        :param itemid: associated id (required)
        :type itemid: int
        :param rateduserid: rated user id (required)
        :type rateduserid: int
        :param rating: user rating (required)
        :type rating: int
        :param ratingarea: rating area (required)
        :type ratingarea: str
        :param scaleid: scale id (required)
        :type scaleid: int
        :param aggregation: agreggation method
        :type aggregation: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_rating_add_rating_serialize(
            component=component,
            contextlevel=contextlevel,
            instanceid=instanceid,
            itemid=itemid,
            rateduserid=rateduserid,
            rating=rating,
            ratingarea=ratingarea,
            scaleid=scaleid,
            aggregation=aggregation,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreRatingAddRatingResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_rating_add_rating(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        contextlevel: Annotated[Optional[StrictStr], Field(description="context level: course, module, user, etc...")],
        instanceid: Annotated[Optional[StrictInt], Field(description="the instance id of item associated with the context level")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        rateduserid: Annotated[Optional[StrictInt], Field(description="rated user id")],
        rating: Annotated[Optional[StrictInt], Field(description="user rating")],
        ratingarea: Annotated[Optional[StrictStr], Field(description="rating area")],
        scaleid: Annotated[Optional[StrictInt], Field(description="scale id")],
        aggregation: Annotated[Optional[StrictInt], Field(description="agreggation method")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreRatingAddRatingResponse:
        """Rates an item.

        Rates an item.

        :param component: component (required)
        :type component: str
        :param contextlevel: context level: course, module, user, etc... (required)
        :type contextlevel: str
        :param instanceid: the instance id of item associated with the context level (required)
        :type instanceid: int
        :param itemid: associated id (required)
        :type itemid: int
        :param rateduserid: rated user id (required)
        :type rateduserid: int
        :param rating: user rating (required)
        :type rating: int
        :param ratingarea: rating area (required)
        :type ratingarea: str
        :param scaleid: scale id (required)
        :type scaleid: int
        :param aggregation: agreggation method
        :type aggregation: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_rating_add_rating_serialize(
            component=component,
            contextlevel=contextlevel,
            instanceid=instanceid,
            itemid=itemid,
            rateduserid=rateduserid,
            rating=rating,
            ratingarea=ratingarea,
            scaleid=scaleid,
            aggregation=aggregation,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreRatingAddRatingResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_rating_add_rating_from_args(
        self,
        args
    ) -> CoreRatingAddRatingResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreRatingAddRatingResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_rating_add_rating_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        contextlevel: Annotated[Optional[StrictStr], Field(description="context level: course, module, user, etc...")],
        instanceid: Annotated[Optional[StrictInt], Field(description="the instance id of item associated with the context level")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        rateduserid: Annotated[Optional[StrictInt], Field(description="rated user id")],
        rating: Annotated[Optional[StrictInt], Field(description="user rating")],
        ratingarea: Annotated[Optional[StrictStr], Field(description="rating area")],
        scaleid: Annotated[Optional[StrictInt], Field(description="scale id")],
        aggregation: Annotated[Optional[StrictInt], Field(description="agreggation method")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreRatingAddRatingResponse]:
        """Rates an item.

        Rates an item.

        :param component: component (required)
        :type component: str
        :param contextlevel: context level: course, module, user, etc... (required)
        :type contextlevel: str
        :param instanceid: the instance id of item associated with the context level (required)
        :type instanceid: int
        :param itemid: associated id (required)
        :type itemid: int
        :param rateduserid: rated user id (required)
        :type rateduserid: int
        :param rating: user rating (required)
        :type rating: int
        :param ratingarea: rating area (required)
        :type ratingarea: str
        :param scaleid: scale id (required)
        :type scaleid: int
        :param aggregation: agreggation method
        :type aggregation: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_rating_add_rating_serialize(
            component=component,
            contextlevel=contextlevel,
            instanceid=instanceid,
            itemid=itemid,
            rateduserid=rateduserid,
            rating=rating,
            ratingarea=ratingarea,
            scaleid=scaleid,
            aggregation=aggregation,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreRatingAddRatingResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_rating_add_rating_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        contextlevel: Annotated[Optional[StrictStr], Field(description="context level: course, module, user, etc...")],
        instanceid: Annotated[Optional[StrictInt], Field(description="the instance id of item associated with the context level")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        rateduserid: Annotated[Optional[StrictInt], Field(description="rated user id")],
        rating: Annotated[Optional[StrictInt], Field(description="user rating")],
        ratingarea: Annotated[Optional[StrictStr], Field(description="rating area")],
        scaleid: Annotated[Optional[StrictInt], Field(description="scale id")],
        aggregation: Annotated[Optional[StrictInt], Field(description="agreggation method")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Rates an item.

        Rates an item.

        :param component: component (required)
        :type component: str
        :param contextlevel: context level: course, module, user, etc... (required)
        :type contextlevel: str
        :param instanceid: the instance id of item associated with the context level (required)
        :type instanceid: int
        :param itemid: associated id (required)
        :type itemid: int
        :param rateduserid: rated user id (required)
        :type rateduserid: int
        :param rating: user rating (required)
        :type rating: int
        :param ratingarea: rating area (required)
        :type ratingarea: str
        :param scaleid: scale id (required)
        :type scaleid: int
        :param aggregation: agreggation method
        :type aggregation: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_rating_add_rating_serialize(
            component=component,
            contextlevel=contextlevel,
            instanceid=instanceid,
            itemid=itemid,
            rateduserid=rateduserid,
            rating=rating,
            ratingarea=ratingarea,
            scaleid=scaleid,
            aggregation=aggregation,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreRatingAddRatingResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_rating_add_rating_serialize(
        self,
        component,
        contextlevel,
        instanceid,
        itemid,
        rateduserid,
        rating,
        ratingarea,
        scaleid,
        aggregation,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_rating_add_rating'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_rating_add_rating'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_rating_add_rating',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if aggregation is not None:
            _form_params += parse_form({'aggregation': aggregation})
        if component is not None:
            _form_params += parse_form({'component': component})
        if contextlevel is not None:
            _form_params += parse_form({'contextlevel': contextlevel})
        if instanceid is not None:
            _form_params += parse_form({'instanceid': instanceid})
        if itemid is not None:
            _form_params += parse_form({'itemid': itemid})
        if rateduserid is not None:
            _form_params += parse_form({'rateduserid': rateduserid})
        if rating is not None:
            _form_params += parse_form({'rating': rating})
        if ratingarea is not None:
            _form_params += parse_form({'ratingarea': ratingarea})
        if scaleid is not None:
            _form_params += parse_form({'scaleid': scaleid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_rating_get_item_ratings_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        contextlevel: Annotated[Optional[StrictStr], Field(description="context level: course, module, user, etc...")],
        instanceid: Annotated[Optional[StrictInt], Field(description="the instance id of item associated with the context level")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        ratingarea: Annotated[Optional[StrictStr], Field(description="rating area")],
        scaleid: Annotated[Optional[StrictInt], Field(description="scale id")],
        sort: Annotated[Optional[StrictStr], Field(description="sort order (firstname, rating or timemodified)")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve all the ratings for an item.

        Retrieve all the ratings for an item.

        :param component: component (required)
        :type component: str
        :param contextlevel: context level: course, module, user, etc... (required)
        :type contextlevel: str
        :param instanceid: the instance id of item associated with the context level (required)
        :type instanceid: int
        :param itemid: associated id (required)
        :type itemid: int
        :param ratingarea: rating area (required)
        :type ratingarea: str
        :param scaleid: scale id (required)
        :type scaleid: int
        :param sort: sort order (firstname, rating or timemodified) (required)
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_rating_get_item_ratings_serialize(
            component=component,
            contextlevel=contextlevel,
            instanceid=instanceid,
            itemid=itemid,
            ratingarea=ratingarea,
            scaleid=scaleid,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreRatingGetItemRatingsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_rating_get_item_ratings(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        contextlevel: Annotated[Optional[StrictStr], Field(description="context level: course, module, user, etc...")],
        instanceid: Annotated[Optional[StrictInt], Field(description="the instance id of item associated with the context level")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        ratingarea: Annotated[Optional[StrictStr], Field(description="rating area")],
        scaleid: Annotated[Optional[StrictInt], Field(description="scale id")],
        sort: Annotated[Optional[StrictStr], Field(description="sort order (firstname, rating or timemodified)")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreRatingGetItemRatingsResponse:
        """Retrieve all the ratings for an item.

        Retrieve all the ratings for an item.

        :param component: component (required)
        :type component: str
        :param contextlevel: context level: course, module, user, etc... (required)
        :type contextlevel: str
        :param instanceid: the instance id of item associated with the context level (required)
        :type instanceid: int
        :param itemid: associated id (required)
        :type itemid: int
        :param ratingarea: rating area (required)
        :type ratingarea: str
        :param scaleid: scale id (required)
        :type scaleid: int
        :param sort: sort order (firstname, rating or timemodified) (required)
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_rating_get_item_ratings_serialize(
            component=component,
            contextlevel=contextlevel,
            instanceid=instanceid,
            itemid=itemid,
            ratingarea=ratingarea,
            scaleid=scaleid,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreRatingGetItemRatingsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_rating_get_item_ratings_from_args(
        self,
        args
    ) -> CoreRatingGetItemRatingsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreRatingGetItemRatingsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_rating_get_item_ratings_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        contextlevel: Annotated[Optional[StrictStr], Field(description="context level: course, module, user, etc...")],
        instanceid: Annotated[Optional[StrictInt], Field(description="the instance id of item associated with the context level")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        ratingarea: Annotated[Optional[StrictStr], Field(description="rating area")],
        scaleid: Annotated[Optional[StrictInt], Field(description="scale id")],
        sort: Annotated[Optional[StrictStr], Field(description="sort order (firstname, rating or timemodified)")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreRatingGetItemRatingsResponse]:
        """Retrieve all the ratings for an item.

        Retrieve all the ratings for an item.

        :param component: component (required)
        :type component: str
        :param contextlevel: context level: course, module, user, etc... (required)
        :type contextlevel: str
        :param instanceid: the instance id of item associated with the context level (required)
        :type instanceid: int
        :param itemid: associated id (required)
        :type itemid: int
        :param ratingarea: rating area (required)
        :type ratingarea: str
        :param scaleid: scale id (required)
        :type scaleid: int
        :param sort: sort order (firstname, rating or timemodified) (required)
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_rating_get_item_ratings_serialize(
            component=component,
            contextlevel=contextlevel,
            instanceid=instanceid,
            itemid=itemid,
            ratingarea=ratingarea,
            scaleid=scaleid,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreRatingGetItemRatingsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_rating_get_item_ratings_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component")],
        contextlevel: Annotated[Optional[StrictStr], Field(description="context level: course, module, user, etc...")],
        instanceid: Annotated[Optional[StrictInt], Field(description="the instance id of item associated with the context level")],
        itemid: Annotated[Optional[StrictInt], Field(description="associated id")],
        ratingarea: Annotated[Optional[StrictStr], Field(description="rating area")],
        scaleid: Annotated[Optional[StrictInt], Field(description="scale id")],
        sort: Annotated[Optional[StrictStr], Field(description="sort order (firstname, rating or timemodified)")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve all the ratings for an item.

        Retrieve all the ratings for an item.

        :param component: component (required)
        :type component: str
        :param contextlevel: context level: course, module, user, etc... (required)
        :type contextlevel: str
        :param instanceid: the instance id of item associated with the context level (required)
        :type instanceid: int
        :param itemid: associated id (required)
        :type itemid: int
        :param ratingarea: rating area (required)
        :type ratingarea: str
        :param scaleid: scale id (required)
        :type scaleid: int
        :param sort: sort order (firstname, rating or timemodified) (required)
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_rating_get_item_ratings_serialize(
            component=component,
            contextlevel=contextlevel,
            instanceid=instanceid,
            itemid=itemid,
            ratingarea=ratingarea,
            scaleid=scaleid,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreRatingGetItemRatingsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_rating_get_item_ratings_serialize(
        self,
        component,
        contextlevel,
        instanceid,
        itemid,
        ratingarea,
        scaleid,
        sort,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_rating_get_item_ratings'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_rating_get_item_ratings'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_rating_get_item_ratings',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if component is not None:
            _form_params += parse_form({'component': component})
        if contextlevel is not None:
            _form_params += parse_form({'contextlevel': contextlevel})
        if instanceid is not None:
            _form_params += parse_form({'instanceid': instanceid})
        if itemid is not None:
            _form_params += parse_form({'itemid': itemid})
        if ratingarea is not None:
            _form_params += parse_form({'ratingarea': ratingarea})
        if scaleid is not None:
            _form_params += parse_form({'scaleid': scaleid})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_audiences_delete_args(
        self,
        instanceid: Annotated[Optional[StrictInt], Field(description="Audience instance id")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete audience from report

        Delete audience from report

        :param instanceid: Audience instance id (required)
        :type instanceid: int
        :param reportid: Report id (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_audiences_delete_serialize(
            instanceid=instanceid,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_audiences_delete(
        self,
        instanceid: Annotated[Optional[StrictInt], Field(description="Audience instance id")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Delete audience from report

        Delete audience from report

        :param instanceid: Audience instance id (required)
        :type instanceid: int
        :param reportid: Report id (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_audiences_delete_serialize(
            instanceid=instanceid,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_audiences_delete_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_audiences_delete_with_http_info(
        self,
        instanceid: Annotated[Optional[StrictInt], Field(description="Audience instance id")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Delete audience from report

        Delete audience from report

        :param instanceid: Audience instance id (required)
        :type instanceid: int
        :param reportid: Report id (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_audiences_delete_serialize(
            instanceid=instanceid,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_audiences_delete_without_preload_content(
        self,
        instanceid: Annotated[Optional[StrictInt], Field(description="Audience instance id")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete audience from report

        Delete audience from report

        :param instanceid: Audience instance id (required)
        :type instanceid: int
        :param reportid: Report id (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_audiences_delete_serialize(
            instanceid=instanceid,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_audiences_delete_serialize(
        self,
        instanceid,
        reportid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_audiences_delete'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_audiences_delete'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_audiences_delete',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if instanceid is not None:
            _form_params += parse_form({'instanceid': instanceid})
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_can_view_system_report_args(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        source: Annotated[Optional[StrictStr], Field(description="Report class path")],
        area: Annotated[Optional[StrictStr], Field(description="Report area")] = None,
        component: Annotated[Optional[StrictStr], Field(description="Report component")] = None,
        itemid: Annotated[Optional[StrictInt], Field(description="Report item ID")] = None,
        parameters: Annotated[Optional[List[CoreReportbuilderCanViewSystemReportParametersParametersInner]], Field(description="Report parameters")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Determine access to a system report

        Determine access to a system report

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param source: Report class path (required)
        :type source: str
        :param area: Report area
        :type area: str
        :param component: Report component
        :type component: str
        :param itemid: Report item ID
        :type itemid: int
        :param parameters: Report parameters
        :type parameters: List[CoreReportbuilderCanViewSystemReportParametersParametersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_can_view_system_report_serialize(
            context=context,
            source=source,
            area=area,
            component=component,
            itemid=itemid,
            parameters=parameters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_can_view_system_report(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        source: Annotated[Optional[StrictStr], Field(description="Report class path")],
        area: Annotated[Optional[StrictStr], Field(description="Report area")] = None,
        component: Annotated[Optional[StrictStr], Field(description="Report component")] = None,
        itemid: Annotated[Optional[StrictInt], Field(description="Report item ID")] = None,
        parameters: Annotated[Optional[List[CoreReportbuilderCanViewSystemReportParametersParametersInner]], Field(description="Report parameters")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Determine access to a system report

        Determine access to a system report

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param source: Report class path (required)
        :type source: str
        :param area: Report area
        :type area: str
        :param component: Report component
        :type component: str
        :param itemid: Report item ID
        :type itemid: int
        :param parameters: Report parameters
        :type parameters: List[CoreReportbuilderCanViewSystemReportParametersParametersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_can_view_system_report_serialize(
            context=context,
            source=source,
            area=area,
            component=component,
            itemid=itemid,
            parameters=parameters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_can_view_system_report_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_can_view_system_report_with_http_info(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        source: Annotated[Optional[StrictStr], Field(description="Report class path")],
        area: Annotated[Optional[StrictStr], Field(description="Report area")] = None,
        component: Annotated[Optional[StrictStr], Field(description="Report component")] = None,
        itemid: Annotated[Optional[StrictInt], Field(description="Report item ID")] = None,
        parameters: Annotated[Optional[List[CoreReportbuilderCanViewSystemReportParametersParametersInner]], Field(description="Report parameters")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Determine access to a system report

        Determine access to a system report

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param source: Report class path (required)
        :type source: str
        :param area: Report area
        :type area: str
        :param component: Report component
        :type component: str
        :param itemid: Report item ID
        :type itemid: int
        :param parameters: Report parameters
        :type parameters: List[CoreReportbuilderCanViewSystemReportParametersParametersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_can_view_system_report_serialize(
            context=context,
            source=source,
            area=area,
            component=component,
            itemid=itemid,
            parameters=parameters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_can_view_system_report_without_preload_content(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        source: Annotated[Optional[StrictStr], Field(description="Report class path")],
        area: Annotated[Optional[StrictStr], Field(description="Report area")] = None,
        component: Annotated[Optional[StrictStr], Field(description="Report component")] = None,
        itemid: Annotated[Optional[StrictInt], Field(description="Report item ID")] = None,
        parameters: Annotated[Optional[List[CoreReportbuilderCanViewSystemReportParametersParametersInner]], Field(description="Report parameters")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Determine access to a system report

        Determine access to a system report

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param source: Report class path (required)
        :type source: str
        :param area: Report area
        :type area: str
        :param component: Report component
        :type component: str
        :param itemid: Report item ID
        :type itemid: int
        :param parameters: Report parameters
        :type parameters: List[CoreReportbuilderCanViewSystemReportParametersParametersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_can_view_system_report_serialize(
            context=context,
            source=source,
            area=area,
            component=component,
            itemid=itemid,
            parameters=parameters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_can_view_system_report_serialize(
        self,
        context,
        source,
        area,
        component,
        itemid,
        parameters,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'parameters': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_can_view_system_report'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_can_view_system_report'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_can_view_system_report',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if area is not None:
            _form_params += parse_form({'area': area})
        if component is not None:
            _form_params += parse_form({'component': component})
        if context is not None:
            _form_params += parse_form({'context': context})
        if itemid is not None:
            _form_params += parse_form({'itemid': itemid})
        if parameters is not None:
            _form_params += parse_form({'parameters': parameters})
        if source is not None:
            _form_params += parse_form({'source': source})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_columns_add_args(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        uniqueidentifier: Annotated[Optional[StrictStr], Field(description="Unique identifier of the column")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Add column to report

        Add column to report

        :param reportid: Report ID (required)
        :type reportid: int
        :param uniqueidentifier: Unique identifier of the column (required)
        :type uniqueidentifier: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_add_serialize(
            reportid=reportid,
            uniqueidentifier=uniqueidentifier,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsAddResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_columns_add(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        uniqueidentifier: Annotated[Optional[StrictStr], Field(description="Unique identifier of the column")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderColumnsAddResponse:
        """Add column to report

        Add column to report

        :param reportid: Report ID (required)
        :type reportid: int
        :param uniqueidentifier: Unique identifier of the column (required)
        :type uniqueidentifier: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_add_serialize(
            reportid=reportid,
            uniqueidentifier=uniqueidentifier,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsAddResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_columns_add_from_args(
        self,
        args
    ) -> CoreReportbuilderColumnsAddResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsAddResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_columns_add_with_http_info(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        uniqueidentifier: Annotated[Optional[StrictStr], Field(description="Unique identifier of the column")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderColumnsAddResponse]:
        """Add column to report

        Add column to report

        :param reportid: Report ID (required)
        :type reportid: int
        :param uniqueidentifier: Unique identifier of the column (required)
        :type uniqueidentifier: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_add_serialize(
            reportid=reportid,
            uniqueidentifier=uniqueidentifier,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsAddResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_columns_add_without_preload_content(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        uniqueidentifier: Annotated[Optional[StrictStr], Field(description="Unique identifier of the column")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Add column to report

        Add column to report

        :param reportid: Report ID (required)
        :type reportid: int
        :param uniqueidentifier: Unique identifier of the column (required)
        :type uniqueidentifier: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_add_serialize(
            reportid=reportid,
            uniqueidentifier=uniqueidentifier,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsAddResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_columns_add_serialize(
        self,
        reportid,
        uniqueidentifier,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_columns_add'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_columns_add'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_columns_add',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        if uniqueidentifier is not None:
            _form_params += parse_form({'uniqueidentifier': uniqueidentifier})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_columns_delete_args(
        self,
        columnid: Annotated[Optional[StrictInt], Field(description="Column ID")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete column from report

        Delete column from report

        :param columnid: Column ID (required)
        :type columnid: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_delete_serialize(
            columnid=columnid,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsDeleteResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_columns_delete(
        self,
        columnid: Annotated[Optional[StrictInt], Field(description="Column ID")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderColumnsDeleteResponse:
        """Delete column from report

        Delete column from report

        :param columnid: Column ID (required)
        :type columnid: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_delete_serialize(
            columnid=columnid,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsDeleteResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_columns_delete_from_args(
        self,
        args
    ) -> CoreReportbuilderColumnsDeleteResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsDeleteResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_columns_delete_with_http_info(
        self,
        columnid: Annotated[Optional[StrictInt], Field(description="Column ID")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderColumnsDeleteResponse]:
        """Delete column from report

        Delete column from report

        :param columnid: Column ID (required)
        :type columnid: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_delete_serialize(
            columnid=columnid,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsDeleteResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_columns_delete_without_preload_content(
        self,
        columnid: Annotated[Optional[StrictInt], Field(description="Column ID")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete column from report

        Delete column from report

        :param columnid: Column ID (required)
        :type columnid: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_delete_serialize(
            columnid=columnid,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsDeleteResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_columns_delete_serialize(
        self,
        columnid,
        reportid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_columns_delete'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_columns_delete'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_columns_delete',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if columnid is not None:
            _form_params += parse_form({'columnid': columnid})
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_columns_reorder_args(
        self,
        columnid: Annotated[Optional[StrictInt], Field(description="Column ID")],
        position: Annotated[Optional[StrictInt], Field(description="New column position")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Re-order column within report

        Re-order column within report

        :param columnid: Column ID (required)
        :type columnid: int
        :param position: New column position (required)
        :type position: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_reorder_serialize(
            columnid=columnid,
            position=position,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_columns_reorder(
        self,
        columnid: Annotated[Optional[StrictInt], Field(description="Column ID")],
        position: Annotated[Optional[StrictInt], Field(description="New column position")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Re-order column within report

        Re-order column within report

        :param columnid: Column ID (required)
        :type columnid: int
        :param position: New column position (required)
        :type position: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_reorder_serialize(
            columnid=columnid,
            position=position,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_columns_reorder_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_columns_reorder_with_http_info(
        self,
        columnid: Annotated[Optional[StrictInt], Field(description="Column ID")],
        position: Annotated[Optional[StrictInt], Field(description="New column position")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Re-order column within report

        Re-order column within report

        :param columnid: Column ID (required)
        :type columnid: int
        :param position: New column position (required)
        :type position: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_reorder_serialize(
            columnid=columnid,
            position=position,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_columns_reorder_without_preload_content(
        self,
        columnid: Annotated[Optional[StrictInt], Field(description="Column ID")],
        position: Annotated[Optional[StrictInt], Field(description="New column position")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Re-order column within report

        Re-order column within report

        :param columnid: Column ID (required)
        :type columnid: int
        :param position: New column position (required)
        :type position: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_reorder_serialize(
            columnid=columnid,
            position=position,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_columns_reorder_serialize(
        self,
        columnid,
        position,
        reportid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_columns_reorder'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_columns_reorder'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_columns_reorder',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if columnid is not None:
            _form_params += parse_form({'columnid': columnid})
        if position is not None:
            _form_params += parse_form({'position': position})
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_columns_sort_get_args(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve column sorting for report

        Retrieve column sorting for report

        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_sort_get_serialize(
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsSortGetResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_columns_sort_get(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderColumnsSortGetResponse:
        """Retrieve column sorting for report

        Retrieve column sorting for report

        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_sort_get_serialize(
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsSortGetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_columns_sort_get_from_args(
        self,
        args
    ) -> CoreReportbuilderColumnsSortGetResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsSortGetResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_columns_sort_get_with_http_info(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderColumnsSortGetResponse]:
        """Retrieve column sorting for report

        Retrieve column sorting for report

        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_sort_get_serialize(
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsSortGetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_columns_sort_get_without_preload_content(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve column sorting for report

        Retrieve column sorting for report

        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_sort_get_serialize(
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsSortGetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_columns_sort_get_serialize(
        self,
        reportid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_columns_sort_get'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_columns_sort_get'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_columns_sort_get',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_columns_sort_reorder_args(
        self,
        columnid: Annotated[Optional[StrictInt], Field(description="Column ID")],
        position: Annotated[Optional[StrictInt], Field(description="New column sort position")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Re-order column sorting within report

        Re-order column sorting within report

        :param columnid: Column ID (required)
        :type columnid: int
        :param position: New column sort position (required)
        :type position: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_sort_reorder_serialize(
            columnid=columnid,
            position=position,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsSortReorderResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_columns_sort_reorder(
        self,
        columnid: Annotated[Optional[StrictInt], Field(description="Column ID")],
        position: Annotated[Optional[StrictInt], Field(description="New column sort position")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderColumnsSortReorderResponse:
        """Re-order column sorting within report

        Re-order column sorting within report

        :param columnid: Column ID (required)
        :type columnid: int
        :param position: New column sort position (required)
        :type position: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_sort_reorder_serialize(
            columnid=columnid,
            position=position,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsSortReorderResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_columns_sort_reorder_from_args(
        self,
        args
    ) -> CoreReportbuilderColumnsSortReorderResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsSortReorderResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_columns_sort_reorder_with_http_info(
        self,
        columnid: Annotated[Optional[StrictInt], Field(description="Column ID")],
        position: Annotated[Optional[StrictInt], Field(description="New column sort position")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderColumnsSortReorderResponse]:
        """Re-order column sorting within report

        Re-order column sorting within report

        :param columnid: Column ID (required)
        :type columnid: int
        :param position: New column sort position (required)
        :type position: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_sort_reorder_serialize(
            columnid=columnid,
            position=position,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsSortReorderResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_columns_sort_reorder_without_preload_content(
        self,
        columnid: Annotated[Optional[StrictInt], Field(description="Column ID")],
        position: Annotated[Optional[StrictInt], Field(description="New column sort position")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Re-order column sorting within report

        Re-order column sorting within report

        :param columnid: Column ID (required)
        :type columnid: int
        :param position: New column sort position (required)
        :type position: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_sort_reorder_serialize(
            columnid=columnid,
            position=position,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsSortReorderResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_columns_sort_reorder_serialize(
        self,
        columnid,
        position,
        reportid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_columns_sort_reorder'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_columns_sort_reorder'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_columns_sort_reorder',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if columnid is not None:
            _form_params += parse_form({'columnid': columnid})
        if position is not None:
            _form_params += parse_form({'position': position})
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_columns_sort_toggle_args(
        self,
        columnid: Annotated[Optional[StrictInt], Field(description="Column ID")],
        enabled: Annotated[Optional[StrictBool], Field(description="Sort enabled")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        direction: Annotated[Optional[StrictInt], Field(description="Sort direction")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Toggle sorting of column within report

        Toggle sorting of column within report

        :param columnid: Column ID (required)
        :type columnid: int
        :param enabled: Sort enabled (required)
        :type enabled: bool
        :param reportid: Report ID (required)
        :type reportid: int
        :param direction: Sort direction
        :type direction: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_sort_toggle_serialize(
            columnid=columnid,
            enabled=enabled,
            reportid=reportid,
            direction=direction,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsSortToggleResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_columns_sort_toggle(
        self,
        columnid: Annotated[Optional[StrictInt], Field(description="Column ID")],
        enabled: Annotated[Optional[StrictBool], Field(description="Sort enabled")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        direction: Annotated[Optional[StrictInt], Field(description="Sort direction")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderColumnsSortToggleResponse:
        """Toggle sorting of column within report

        Toggle sorting of column within report

        :param columnid: Column ID (required)
        :type columnid: int
        :param enabled: Sort enabled (required)
        :type enabled: bool
        :param reportid: Report ID (required)
        :type reportid: int
        :param direction: Sort direction
        :type direction: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_sort_toggle_serialize(
            columnid=columnid,
            enabled=enabled,
            reportid=reportid,
            direction=direction,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsSortToggleResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_columns_sort_toggle_from_args(
        self,
        args
    ) -> CoreReportbuilderColumnsSortToggleResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsSortToggleResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_columns_sort_toggle_with_http_info(
        self,
        columnid: Annotated[Optional[StrictInt], Field(description="Column ID")],
        enabled: Annotated[Optional[StrictBool], Field(description="Sort enabled")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        direction: Annotated[Optional[StrictInt], Field(description="Sort direction")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderColumnsSortToggleResponse]:
        """Toggle sorting of column within report

        Toggle sorting of column within report

        :param columnid: Column ID (required)
        :type columnid: int
        :param enabled: Sort enabled (required)
        :type enabled: bool
        :param reportid: Report ID (required)
        :type reportid: int
        :param direction: Sort direction
        :type direction: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_sort_toggle_serialize(
            columnid=columnid,
            enabled=enabled,
            reportid=reportid,
            direction=direction,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsSortToggleResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_columns_sort_toggle_without_preload_content(
        self,
        columnid: Annotated[Optional[StrictInt], Field(description="Column ID")],
        enabled: Annotated[Optional[StrictBool], Field(description="Sort enabled")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        direction: Annotated[Optional[StrictInt], Field(description="Sort direction")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Toggle sorting of column within report

        Toggle sorting of column within report

        :param columnid: Column ID (required)
        :type columnid: int
        :param enabled: Sort enabled (required)
        :type enabled: bool
        :param reportid: Report ID (required)
        :type reportid: int
        :param direction: Sort direction
        :type direction: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_columns_sort_toggle_serialize(
            columnid=columnid,
            enabled=enabled,
            reportid=reportid,
            direction=direction,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderColumnsSortToggleResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_columns_sort_toggle_serialize(
        self,
        columnid,
        enabled,
        reportid,
        direction,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_columns_sort_toggle'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_columns_sort_toggle'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_columns_sort_toggle',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if columnid is not None:
            _form_params += parse_form({'columnid': columnid})
        if direction is not None:
            _form_params += parse_form({'direction': direction})
        if enabled is not None:
            _form_params += parse_form({'enabled': enabled})
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_conditions_add_args(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        uniqueidentifier: Annotated[Optional[StrictStr], Field(description="Unique identifier of the condition")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Add condition to report

        Add condition to report

        :param reportid: Report ID (required)
        :type reportid: int
        :param uniqueidentifier: Unique identifier of the condition (required)
        :type uniqueidentifier: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_conditions_add_serialize(
            reportid=reportid,
            uniqueidentifier=uniqueidentifier,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsAddResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_conditions_add(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        uniqueidentifier: Annotated[Optional[StrictStr], Field(description="Unique identifier of the condition")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderConditionsAddResponse:
        """Add condition to report

        Add condition to report

        :param reportid: Report ID (required)
        :type reportid: int
        :param uniqueidentifier: Unique identifier of the condition (required)
        :type uniqueidentifier: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_conditions_add_serialize(
            reportid=reportid,
            uniqueidentifier=uniqueidentifier,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsAddResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_conditions_add_from_args(
        self,
        args
    ) -> CoreReportbuilderConditionsAddResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsAddResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_conditions_add_with_http_info(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        uniqueidentifier: Annotated[Optional[StrictStr], Field(description="Unique identifier of the condition")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderConditionsAddResponse]:
        """Add condition to report

        Add condition to report

        :param reportid: Report ID (required)
        :type reportid: int
        :param uniqueidentifier: Unique identifier of the condition (required)
        :type uniqueidentifier: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_conditions_add_serialize(
            reportid=reportid,
            uniqueidentifier=uniqueidentifier,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsAddResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_conditions_add_without_preload_content(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        uniqueidentifier: Annotated[Optional[StrictStr], Field(description="Unique identifier of the condition")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Add condition to report

        Add condition to report

        :param reportid: Report ID (required)
        :type reportid: int
        :param uniqueidentifier: Unique identifier of the condition (required)
        :type uniqueidentifier: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_conditions_add_serialize(
            reportid=reportid,
            uniqueidentifier=uniqueidentifier,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsAddResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_conditions_add_serialize(
        self,
        reportid,
        uniqueidentifier,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_conditions_add'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_conditions_add'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_conditions_add',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        if uniqueidentifier is not None:
            _form_params += parse_form({'uniqueidentifier': uniqueidentifier})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_conditions_delete_args(
        self,
        conditionid: Annotated[Optional[StrictInt], Field(description="Condition ID")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete condition from report

        Delete condition from report

        :param conditionid: Condition ID (required)
        :type conditionid: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_conditions_delete_serialize(
            conditionid=conditionid,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsDeleteResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_conditions_delete(
        self,
        conditionid: Annotated[Optional[StrictInt], Field(description="Condition ID")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderConditionsDeleteResponse:
        """Delete condition from report

        Delete condition from report

        :param conditionid: Condition ID (required)
        :type conditionid: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_conditions_delete_serialize(
            conditionid=conditionid,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsDeleteResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_conditions_delete_from_args(
        self,
        args
    ) -> CoreReportbuilderConditionsDeleteResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsDeleteResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_conditions_delete_with_http_info(
        self,
        conditionid: Annotated[Optional[StrictInt], Field(description="Condition ID")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderConditionsDeleteResponse]:
        """Delete condition from report

        Delete condition from report

        :param conditionid: Condition ID (required)
        :type conditionid: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_conditions_delete_serialize(
            conditionid=conditionid,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsDeleteResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_conditions_delete_without_preload_content(
        self,
        conditionid: Annotated[Optional[StrictInt], Field(description="Condition ID")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete condition from report

        Delete condition from report

        :param conditionid: Condition ID (required)
        :type conditionid: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_conditions_delete_serialize(
            conditionid=conditionid,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsDeleteResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_conditions_delete_serialize(
        self,
        conditionid,
        reportid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_conditions_delete'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_conditions_delete'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_conditions_delete',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if conditionid is not None:
            _form_params += parse_form({'conditionid': conditionid})
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_conditions_reorder_args(
        self,
        conditionid: Annotated[Optional[StrictInt], Field(description="Condition ID")],
        position: Annotated[Optional[StrictInt], Field(description="New condition position")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Re-order condition within report

        Re-order condition within report

        :param conditionid: Condition ID (required)
        :type conditionid: int
        :param position: New condition position (required)
        :type position: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_conditions_reorder_serialize(
            conditionid=conditionid,
            position=position,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsReorderResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_conditions_reorder(
        self,
        conditionid: Annotated[Optional[StrictInt], Field(description="Condition ID")],
        position: Annotated[Optional[StrictInt], Field(description="New condition position")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderConditionsReorderResponse:
        """Re-order condition within report

        Re-order condition within report

        :param conditionid: Condition ID (required)
        :type conditionid: int
        :param position: New condition position (required)
        :type position: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_conditions_reorder_serialize(
            conditionid=conditionid,
            position=position,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsReorderResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_conditions_reorder_from_args(
        self,
        args
    ) -> CoreReportbuilderConditionsReorderResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsReorderResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_conditions_reorder_with_http_info(
        self,
        conditionid: Annotated[Optional[StrictInt], Field(description="Condition ID")],
        position: Annotated[Optional[StrictInt], Field(description="New condition position")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderConditionsReorderResponse]:
        """Re-order condition within report

        Re-order condition within report

        :param conditionid: Condition ID (required)
        :type conditionid: int
        :param position: New condition position (required)
        :type position: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_conditions_reorder_serialize(
            conditionid=conditionid,
            position=position,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsReorderResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_conditions_reorder_without_preload_content(
        self,
        conditionid: Annotated[Optional[StrictInt], Field(description="Condition ID")],
        position: Annotated[Optional[StrictInt], Field(description="New condition position")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Re-order condition within report

        Re-order condition within report

        :param conditionid: Condition ID (required)
        :type conditionid: int
        :param position: New condition position (required)
        :type position: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_conditions_reorder_serialize(
            conditionid=conditionid,
            position=position,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsReorderResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_conditions_reorder_serialize(
        self,
        conditionid,
        position,
        reportid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_conditions_reorder'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_conditions_reorder'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_conditions_reorder',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if conditionid is not None:
            _form_params += parse_form({'conditionid': conditionid})
        if position is not None:
            _form_params += parse_form({'position': position})
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_conditions_reset_args(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Reset conditions for given report

        Reset conditions for given report

        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_conditions_reset_serialize(
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsResetResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_conditions_reset(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderConditionsResetResponse:
        """Reset conditions for given report

        Reset conditions for given report

        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_conditions_reset_serialize(
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsResetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_conditions_reset_from_args(
        self,
        args
    ) -> CoreReportbuilderConditionsResetResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsResetResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_conditions_reset_with_http_info(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderConditionsResetResponse]:
        """Reset conditions for given report

        Reset conditions for given report

        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_conditions_reset_serialize(
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsResetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_conditions_reset_without_preload_content(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Reset conditions for given report

        Reset conditions for given report

        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_conditions_reset_serialize(
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderConditionsResetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_conditions_reset_serialize(
        self,
        reportid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_conditions_reset'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_conditions_reset'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_conditions_reset',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_filters_add_args(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        uniqueidentifier: Annotated[Optional[StrictStr], Field(description="Unique identifier of the filter")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Add filter to report

        Add filter to report

        :param reportid: Report ID (required)
        :type reportid: int
        :param uniqueidentifier: Unique identifier of the filter (required)
        :type uniqueidentifier: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_filters_add_serialize(
            reportid=reportid,
            uniqueidentifier=uniqueidentifier,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderFiltersAddResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_filters_add(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        uniqueidentifier: Annotated[Optional[StrictStr], Field(description="Unique identifier of the filter")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderFiltersAddResponse:
        """Add filter to report

        Add filter to report

        :param reportid: Report ID (required)
        :type reportid: int
        :param uniqueidentifier: Unique identifier of the filter (required)
        :type uniqueidentifier: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_filters_add_serialize(
            reportid=reportid,
            uniqueidentifier=uniqueidentifier,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderFiltersAddResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_filters_add_from_args(
        self,
        args
    ) -> CoreReportbuilderFiltersAddResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderFiltersAddResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_filters_add_with_http_info(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        uniqueidentifier: Annotated[Optional[StrictStr], Field(description="Unique identifier of the filter")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderFiltersAddResponse]:
        """Add filter to report

        Add filter to report

        :param reportid: Report ID (required)
        :type reportid: int
        :param uniqueidentifier: Unique identifier of the filter (required)
        :type uniqueidentifier: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_filters_add_serialize(
            reportid=reportid,
            uniqueidentifier=uniqueidentifier,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderFiltersAddResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_filters_add_without_preload_content(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        uniqueidentifier: Annotated[Optional[StrictStr], Field(description="Unique identifier of the filter")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Add filter to report

        Add filter to report

        :param reportid: Report ID (required)
        :type reportid: int
        :param uniqueidentifier: Unique identifier of the filter (required)
        :type uniqueidentifier: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_filters_add_serialize(
            reportid=reportid,
            uniqueidentifier=uniqueidentifier,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderFiltersAddResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_filters_add_serialize(
        self,
        reportid,
        uniqueidentifier,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_filters_add'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_filters_add'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_filters_add',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        if uniqueidentifier is not None:
            _form_params += parse_form({'uniqueidentifier': uniqueidentifier})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_filters_delete_args(
        self,
        filterid: Annotated[Optional[StrictInt], Field(description="Filter ID")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete filter from report

        Delete filter from report

        :param filterid: Filter ID (required)
        :type filterid: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_filters_delete_serialize(
            filterid=filterid,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderFiltersDeleteResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_filters_delete(
        self,
        filterid: Annotated[Optional[StrictInt], Field(description="Filter ID")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderFiltersDeleteResponse:
        """Delete filter from report

        Delete filter from report

        :param filterid: Filter ID (required)
        :type filterid: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_filters_delete_serialize(
            filterid=filterid,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderFiltersDeleteResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_filters_delete_from_args(
        self,
        args
    ) -> CoreReportbuilderFiltersDeleteResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderFiltersDeleteResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_filters_delete_with_http_info(
        self,
        filterid: Annotated[Optional[StrictInt], Field(description="Filter ID")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderFiltersDeleteResponse]:
        """Delete filter from report

        Delete filter from report

        :param filterid: Filter ID (required)
        :type filterid: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_filters_delete_serialize(
            filterid=filterid,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderFiltersDeleteResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_filters_delete_without_preload_content(
        self,
        filterid: Annotated[Optional[StrictInt], Field(description="Filter ID")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete filter from report

        Delete filter from report

        :param filterid: Filter ID (required)
        :type filterid: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_filters_delete_serialize(
            filterid=filterid,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderFiltersDeleteResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_filters_delete_serialize(
        self,
        filterid,
        reportid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_filters_delete'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_filters_delete'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_filters_delete',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if filterid is not None:
            _form_params += parse_form({'filterid': filterid})
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_filters_reorder_args(
        self,
        filterid: Annotated[Optional[StrictInt], Field(description="Filter ID")],
        position: Annotated[Optional[StrictInt], Field(description="New filter position")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Re-order filter within report

        Re-order filter within report

        :param filterid: Filter ID (required)
        :type filterid: int
        :param position: New filter position (required)
        :type position: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_filters_reorder_serialize(
            filterid=filterid,
            position=position,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderFiltersReorderResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_filters_reorder(
        self,
        filterid: Annotated[Optional[StrictInt], Field(description="Filter ID")],
        position: Annotated[Optional[StrictInt], Field(description="New filter position")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderFiltersReorderResponse:
        """Re-order filter within report

        Re-order filter within report

        :param filterid: Filter ID (required)
        :type filterid: int
        :param position: New filter position (required)
        :type position: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_filters_reorder_serialize(
            filterid=filterid,
            position=position,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderFiltersReorderResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_filters_reorder_from_args(
        self,
        args
    ) -> CoreReportbuilderFiltersReorderResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderFiltersReorderResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_filters_reorder_with_http_info(
        self,
        filterid: Annotated[Optional[StrictInt], Field(description="Filter ID")],
        position: Annotated[Optional[StrictInt], Field(description="New filter position")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderFiltersReorderResponse]:
        """Re-order filter within report

        Re-order filter within report

        :param filterid: Filter ID (required)
        :type filterid: int
        :param position: New filter position (required)
        :type position: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_filters_reorder_serialize(
            filterid=filterid,
            position=position,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderFiltersReorderResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_filters_reorder_without_preload_content(
        self,
        filterid: Annotated[Optional[StrictInt], Field(description="Filter ID")],
        position: Annotated[Optional[StrictInt], Field(description="New filter position")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Re-order filter within report

        Re-order filter within report

        :param filterid: Filter ID (required)
        :type filterid: int
        :param position: New filter position (required)
        :type position: int
        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_filters_reorder_serialize(
            filterid=filterid,
            position=position,
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderFiltersReorderResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_filters_reorder_serialize(
        self,
        filterid,
        position,
        reportid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_filters_reorder'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_filters_reorder'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_filters_reorder',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if filterid is not None:
            _form_params += parse_form({'filterid': filterid})
        if position is not None:
            _form_params += parse_form({'position': position})
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_filters_reset_args(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        parameters: Annotated[Optional[StrictStr], Field(description="JSON encoded report parameters")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Reset filters for given report

        Reset filters for given report

        :param reportid: Report ID (required)
        :type reportid: int
        :param parameters: JSON encoded report parameters
        :type parameters: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_filters_reset_serialize(
            reportid=reportid,
            parameters=parameters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_filters_reset(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        parameters: Annotated[Optional[StrictStr], Field(description="JSON encoded report parameters")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Reset filters for given report

        Reset filters for given report

        :param reportid: Report ID (required)
        :type reportid: int
        :param parameters: JSON encoded report parameters
        :type parameters: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_filters_reset_serialize(
            reportid=reportid,
            parameters=parameters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_filters_reset_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_filters_reset_with_http_info(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        parameters: Annotated[Optional[StrictStr], Field(description="JSON encoded report parameters")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Reset filters for given report

        Reset filters for given report

        :param reportid: Report ID (required)
        :type reportid: int
        :param parameters: JSON encoded report parameters
        :type parameters: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_filters_reset_serialize(
            reportid=reportid,
            parameters=parameters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_filters_reset_without_preload_content(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        parameters: Annotated[Optional[StrictStr], Field(description="JSON encoded report parameters")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Reset filters for given report

        Reset filters for given report

        :param reportid: Report ID (required)
        :type reportid: int
        :param parameters: JSON encoded report parameters
        :type parameters: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_filters_reset_serialize(
            reportid=reportid,
            parameters=parameters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_filters_reset_serialize(
        self,
        reportid,
        parameters,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_filters_reset'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_filters_reset'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_filters_reset',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if parameters is not None:
            _form_params += parse_form({'parameters': parameters})
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_list_reports_args(
        self,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="Reports per page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """List custom reports for current user

        List custom reports for current user

        :param page: Page number
        :type page: int
        :param perpage: Reports per page
        :type perpage: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_list_reports_serialize(
            page=page,
            perpage=perpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderListReportsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_list_reports(
        self,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="Reports per page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderListReportsResponse:
        """List custom reports for current user

        List custom reports for current user

        :param page: Page number
        :type page: int
        :param perpage: Reports per page
        :type perpage: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_list_reports_serialize(
            page=page,
            perpage=perpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderListReportsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_list_reports_from_args(
        self,
        args
    ) -> CoreReportbuilderListReportsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderListReportsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_list_reports_with_http_info(
        self,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="Reports per page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderListReportsResponse]:
        """List custom reports for current user

        List custom reports for current user

        :param page: Page number
        :type page: int
        :param perpage: Reports per page
        :type perpage: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_list_reports_serialize(
            page=page,
            perpage=perpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderListReportsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_list_reports_without_preload_content(
        self,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="Reports per page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List custom reports for current user

        List custom reports for current user

        :param page: Page number
        :type page: int
        :param perpage: Reports per page
        :type perpage: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_list_reports_serialize(
            page=page,
            perpage=perpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderListReportsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_list_reports_serialize(
        self,
        page,
        perpage,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_list_reports'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_list_reports'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_list_reports',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if page is not None:
            _form_params += parse_form({'page': page})
        if perpage is not None:
            _form_params += parse_form({'perpage': perpage})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_reports_delete_args(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete report

        Delete report

        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_reports_delete_serialize(
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_reports_delete(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Delete report

        Delete report

        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_reports_delete_serialize(
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_reports_delete_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_reports_delete_with_http_info(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Delete report

        Delete report

        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_reports_delete_serialize(
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_reports_delete_without_preload_content(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete report

        Delete report

        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_reports_delete_serialize(
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_reports_delete_serialize(
        self,
        reportid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_reports_delete'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_reports_delete'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_reports_delete',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_reports_get_args(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        editmode: Annotated[Optional[StrictBool], Field(description="Whether editing mode is enabled")] = None,
        pagesize: Annotated[Optional[StrictInt], Field(description="Page size")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get custom report

        Get custom report

        :param reportid: Report ID (required)
        :type reportid: int
        :param editmode: Whether editing mode is enabled
        :type editmode: bool
        :param pagesize: Page size
        :type pagesize: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_reports_get_serialize(
            reportid=reportid,
            editmode=editmode,
            pagesize=pagesize,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderReportsGetResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_reports_get(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        editmode: Annotated[Optional[StrictBool], Field(description="Whether editing mode is enabled")] = None,
        pagesize: Annotated[Optional[StrictInt], Field(description="Page size")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderReportsGetResponse:
        """Get custom report

        Get custom report

        :param reportid: Report ID (required)
        :type reportid: int
        :param editmode: Whether editing mode is enabled
        :type editmode: bool
        :param pagesize: Page size
        :type pagesize: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_reports_get_serialize(
            reportid=reportid,
            editmode=editmode,
            pagesize=pagesize,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderReportsGetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_reports_get_from_args(
        self,
        args
    ) -> CoreReportbuilderReportsGetResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderReportsGetResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_reports_get_with_http_info(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        editmode: Annotated[Optional[StrictBool], Field(description="Whether editing mode is enabled")] = None,
        pagesize: Annotated[Optional[StrictInt], Field(description="Page size")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderReportsGetResponse]:
        """Get custom report

        Get custom report

        :param reportid: Report ID (required)
        :type reportid: int
        :param editmode: Whether editing mode is enabled
        :type editmode: bool
        :param pagesize: Page size
        :type pagesize: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_reports_get_serialize(
            reportid=reportid,
            editmode=editmode,
            pagesize=pagesize,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderReportsGetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_reports_get_without_preload_content(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        editmode: Annotated[Optional[StrictBool], Field(description="Whether editing mode is enabled")] = None,
        pagesize: Annotated[Optional[StrictInt], Field(description="Page size")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get custom report

        Get custom report

        :param reportid: Report ID (required)
        :type reportid: int
        :param editmode: Whether editing mode is enabled
        :type editmode: bool
        :param pagesize: Page size
        :type pagesize: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_reports_get_serialize(
            reportid=reportid,
            editmode=editmode,
            pagesize=pagesize,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderReportsGetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_reports_get_serialize(
        self,
        reportid,
        editmode,
        pagesize,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_reports_get'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_reports_get'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_reports_get',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if editmode is not None:
            _form_params += parse_form({'editmode': editmode})
        if pagesize is not None:
            _form_params += parse_form({'pagesize': pagesize})
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_retrieve_report_args(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="Reports per page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve custom report content

        Retrieve custom report content

        :param reportid: Report ID (required)
        :type reportid: int
        :param page: Page number
        :type page: int
        :param perpage: Reports per page
        :type perpage: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_retrieve_report_serialize(
            reportid=reportid,
            page=page,
            perpage=perpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderRetrieveReportResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_retrieve_report(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="Reports per page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderRetrieveReportResponse:
        """Retrieve custom report content

        Retrieve custom report content

        :param reportid: Report ID (required)
        :type reportid: int
        :param page: Page number
        :type page: int
        :param perpage: Reports per page
        :type perpage: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_retrieve_report_serialize(
            reportid=reportid,
            page=page,
            perpage=perpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderRetrieveReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_retrieve_report_from_args(
        self,
        args
    ) -> CoreReportbuilderRetrieveReportResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderRetrieveReportResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_retrieve_report_with_http_info(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="Reports per page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderRetrieveReportResponse]:
        """Retrieve custom report content

        Retrieve custom report content

        :param reportid: Report ID (required)
        :type reportid: int
        :param page: Page number
        :type page: int
        :param perpage: Reports per page
        :type perpage: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_retrieve_report_serialize(
            reportid=reportid,
            page=page,
            perpage=perpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderRetrieveReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_retrieve_report_without_preload_content(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="Reports per page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve custom report content

        Retrieve custom report content

        :param reportid: Report ID (required)
        :type reportid: int
        :param page: Page number
        :type page: int
        :param perpage: Reports per page
        :type perpage: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_retrieve_report_serialize(
            reportid=reportid,
            page=page,
            perpage=perpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderRetrieveReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_retrieve_report_serialize(
        self,
        reportid,
        page,
        perpage,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_retrieve_report'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_retrieve_report'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_retrieve_report',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if page is not None:
            _form_params += parse_form({'page': page})
        if perpage is not None:
            _form_params += parse_form({'perpage': perpage})
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_retrieve_system_report_args(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        source: Annotated[Optional[StrictStr], Field(description="Report class path")],
        area: Annotated[Optional[StrictStr], Field(description="Report area")] = None,
        component: Annotated[Optional[StrictStr], Field(description="Report component")] = None,
        itemid: Annotated[Optional[StrictInt], Field(description="Report item ID")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        parameters: Annotated[Optional[List[CoreReportbuilderCanViewSystemReportParametersParametersInner]], Field(description="Report parameters")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="Reports per page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve system report content

        Retrieve system report content

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param source: Report class path (required)
        :type source: str
        :param area: Report area
        :type area: str
        :param component: Report component
        :type component: str
        :param itemid: Report item ID
        :type itemid: int
        :param page: Page number
        :type page: int
        :param parameters: Report parameters
        :type parameters: List[CoreReportbuilderCanViewSystemReportParametersParametersInner]
        :param perpage: Reports per page
        :type perpage: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_retrieve_system_report_serialize(
            context=context,
            source=source,
            area=area,
            component=component,
            itemid=itemid,
            page=page,
            parameters=parameters,
            perpage=perpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderRetrieveSystemReportResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_retrieve_system_report(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        source: Annotated[Optional[StrictStr], Field(description="Report class path")],
        area: Annotated[Optional[StrictStr], Field(description="Report area")] = None,
        component: Annotated[Optional[StrictStr], Field(description="Report component")] = None,
        itemid: Annotated[Optional[StrictInt], Field(description="Report item ID")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        parameters: Annotated[Optional[List[CoreReportbuilderCanViewSystemReportParametersParametersInner]], Field(description="Report parameters")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="Reports per page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderRetrieveSystemReportResponse:
        """Retrieve system report content

        Retrieve system report content

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param source: Report class path (required)
        :type source: str
        :param area: Report area
        :type area: str
        :param component: Report component
        :type component: str
        :param itemid: Report item ID
        :type itemid: int
        :param page: Page number
        :type page: int
        :param parameters: Report parameters
        :type parameters: List[CoreReportbuilderCanViewSystemReportParametersParametersInner]
        :param perpage: Reports per page
        :type perpage: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_retrieve_system_report_serialize(
            context=context,
            source=source,
            area=area,
            component=component,
            itemid=itemid,
            page=page,
            parameters=parameters,
            perpage=perpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderRetrieveSystemReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_retrieve_system_report_from_args(
        self,
        args
    ) -> CoreReportbuilderRetrieveSystemReportResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderRetrieveSystemReportResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_retrieve_system_report_with_http_info(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        source: Annotated[Optional[StrictStr], Field(description="Report class path")],
        area: Annotated[Optional[StrictStr], Field(description="Report area")] = None,
        component: Annotated[Optional[StrictStr], Field(description="Report component")] = None,
        itemid: Annotated[Optional[StrictInt], Field(description="Report item ID")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        parameters: Annotated[Optional[List[CoreReportbuilderCanViewSystemReportParametersParametersInner]], Field(description="Report parameters")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="Reports per page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderRetrieveSystemReportResponse]:
        """Retrieve system report content

        Retrieve system report content

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param source: Report class path (required)
        :type source: str
        :param area: Report area
        :type area: str
        :param component: Report component
        :type component: str
        :param itemid: Report item ID
        :type itemid: int
        :param page: Page number
        :type page: int
        :param parameters: Report parameters
        :type parameters: List[CoreReportbuilderCanViewSystemReportParametersParametersInner]
        :param perpage: Reports per page
        :type perpage: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_retrieve_system_report_serialize(
            context=context,
            source=source,
            area=area,
            component=component,
            itemid=itemid,
            page=page,
            parameters=parameters,
            perpage=perpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderRetrieveSystemReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_retrieve_system_report_without_preload_content(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        source: Annotated[Optional[StrictStr], Field(description="Report class path")],
        area: Annotated[Optional[StrictStr], Field(description="Report area")] = None,
        component: Annotated[Optional[StrictStr], Field(description="Report component")] = None,
        itemid: Annotated[Optional[StrictInt], Field(description="Report item ID")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        parameters: Annotated[Optional[List[CoreReportbuilderCanViewSystemReportParametersParametersInner]], Field(description="Report parameters")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="Reports per page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve system report content

        Retrieve system report content

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param source: Report class path (required)
        :type source: str
        :param area: Report area
        :type area: str
        :param component: Report component
        :type component: str
        :param itemid: Report item ID
        :type itemid: int
        :param page: Page number
        :type page: int
        :param parameters: Report parameters
        :type parameters: List[CoreReportbuilderCanViewSystemReportParametersParametersInner]
        :param perpage: Reports per page
        :type perpage: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_retrieve_system_report_serialize(
            context=context,
            source=source,
            area=area,
            component=component,
            itemid=itemid,
            page=page,
            parameters=parameters,
            perpage=perpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderRetrieveSystemReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_retrieve_system_report_serialize(
        self,
        context,
        source,
        area,
        component,
        itemid,
        page,
        parameters,
        perpage,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'parameters': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_retrieve_system_report'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_retrieve_system_report'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_retrieve_system_report',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if area is not None:
            _form_params += parse_form({'area': area})
        if component is not None:
            _form_params += parse_form({'component': component})
        if context is not None:
            _form_params += parse_form({'context': context})
        if itemid is not None:
            _form_params += parse_form({'itemid': itemid})
        if page is not None:
            _form_params += parse_form({'page': page})
        if parameters is not None:
            _form_params += parse_form({'parameters': parameters})
        if perpage is not None:
            _form_params += parse_form({'perpage': perpage})
        if source is not None:
            _form_params += parse_form({'source': source})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_schedules_delete_args(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        scheduleid: Annotated[Optional[StrictInt], Field(description="Schedule ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete schedule from report

        Delete schedule from report

        :param reportid: Report ID (required)
        :type reportid: int
        :param scheduleid: Schedule ID (required)
        :type scheduleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_schedules_delete_serialize(
            reportid=reportid,
            scheduleid=scheduleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_schedules_delete(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        scheduleid: Annotated[Optional[StrictInt], Field(description="Schedule ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Delete schedule from report

        Delete schedule from report

        :param reportid: Report ID (required)
        :type reportid: int
        :param scheduleid: Schedule ID (required)
        :type scheduleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_schedules_delete_serialize(
            reportid=reportid,
            scheduleid=scheduleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_schedules_delete_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_schedules_delete_with_http_info(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        scheduleid: Annotated[Optional[StrictInt], Field(description="Schedule ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Delete schedule from report

        Delete schedule from report

        :param reportid: Report ID (required)
        :type reportid: int
        :param scheduleid: Schedule ID (required)
        :type scheduleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_schedules_delete_serialize(
            reportid=reportid,
            scheduleid=scheduleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_schedules_delete_without_preload_content(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        scheduleid: Annotated[Optional[StrictInt], Field(description="Schedule ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete schedule from report

        Delete schedule from report

        :param reportid: Report ID (required)
        :type reportid: int
        :param scheduleid: Schedule ID (required)
        :type scheduleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_schedules_delete_serialize(
            reportid=reportid,
            scheduleid=scheduleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_schedules_delete_serialize(
        self,
        reportid,
        scheduleid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_schedules_delete'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_schedules_delete'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_schedules_delete',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        if scheduleid is not None:
            _form_params += parse_form({'scheduleid': scheduleid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_schedules_send_args(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        scheduleid: Annotated[Optional[StrictInt], Field(description="Schedule ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Send report schedule

        Send report schedule

        :param reportid: Report ID (required)
        :type reportid: int
        :param scheduleid: Schedule ID (required)
        :type scheduleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_schedules_send_serialize(
            reportid=reportid,
            scheduleid=scheduleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_schedules_send(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        scheduleid: Annotated[Optional[StrictInt], Field(description="Schedule ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Send report schedule

        Send report schedule

        :param reportid: Report ID (required)
        :type reportid: int
        :param scheduleid: Schedule ID (required)
        :type scheduleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_schedules_send_serialize(
            reportid=reportid,
            scheduleid=scheduleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_schedules_send_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_schedules_send_with_http_info(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        scheduleid: Annotated[Optional[StrictInt], Field(description="Schedule ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Send report schedule

        Send report schedule

        :param reportid: Report ID (required)
        :type reportid: int
        :param scheduleid: Schedule ID (required)
        :type scheduleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_schedules_send_serialize(
            reportid=reportid,
            scheduleid=scheduleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_schedules_send_without_preload_content(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        scheduleid: Annotated[Optional[StrictInt], Field(description="Schedule ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Send report schedule

        Send report schedule

        :param reportid: Report ID (required)
        :type reportid: int
        :param scheduleid: Schedule ID (required)
        :type scheduleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_schedules_send_serialize(
            reportid=reportid,
            scheduleid=scheduleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_schedules_send_serialize(
        self,
        reportid,
        scheduleid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_schedules_send'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_schedules_send'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_schedules_send',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        if scheduleid is not None:
            _form_params += parse_form({'scheduleid': scheduleid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_schedules_toggle_args(
        self,
        enabled: Annotated[Optional[StrictBool], Field(description="Schedule enabled")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        scheduleid: Annotated[Optional[StrictInt], Field(description="Schedule ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Toggle state of report schedule

        Toggle state of report schedule

        :param enabled: Schedule enabled (required)
        :type enabled: bool
        :param reportid: Report ID (required)
        :type reportid: int
        :param scheduleid: Schedule ID (required)
        :type scheduleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_schedules_toggle_serialize(
            enabled=enabled,
            reportid=reportid,
            scheduleid=scheduleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_schedules_toggle(
        self,
        enabled: Annotated[Optional[StrictBool], Field(description="Schedule enabled")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        scheduleid: Annotated[Optional[StrictInt], Field(description="Schedule ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Toggle state of report schedule

        Toggle state of report schedule

        :param enabled: Schedule enabled (required)
        :type enabled: bool
        :param reportid: Report ID (required)
        :type reportid: int
        :param scheduleid: Schedule ID (required)
        :type scheduleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_schedules_toggle_serialize(
            enabled=enabled,
            reportid=reportid,
            scheduleid=scheduleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_schedules_toggle_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_schedules_toggle_with_http_info(
        self,
        enabled: Annotated[Optional[StrictBool], Field(description="Schedule enabled")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        scheduleid: Annotated[Optional[StrictInt], Field(description="Schedule ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Toggle state of report schedule

        Toggle state of report schedule

        :param enabled: Schedule enabled (required)
        :type enabled: bool
        :param reportid: Report ID (required)
        :type reportid: int
        :param scheduleid: Schedule ID (required)
        :type scheduleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_schedules_toggle_serialize(
            enabled=enabled,
            reportid=reportid,
            scheduleid=scheduleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_schedules_toggle_without_preload_content(
        self,
        enabled: Annotated[Optional[StrictBool], Field(description="Schedule enabled")],
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        scheduleid: Annotated[Optional[StrictInt], Field(description="Schedule ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Toggle state of report schedule

        Toggle state of report schedule

        :param enabled: Schedule enabled (required)
        :type enabled: bool
        :param reportid: Report ID (required)
        :type reportid: int
        :param scheduleid: Schedule ID (required)
        :type scheduleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_schedules_toggle_serialize(
            enabled=enabled,
            reportid=reportid,
            scheduleid=scheduleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_schedules_toggle_serialize(
        self,
        enabled,
        reportid,
        scheduleid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_schedules_toggle'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_schedules_toggle'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_schedules_toggle',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if enabled is not None:
            _form_params += parse_form({'enabled': enabled})
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        if scheduleid is not None:
            _form_params += parse_form({'scheduleid': scheduleid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_set_filters_args(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        values: Annotated[Optional[StrictStr], Field(description="JSON encoded filter values")],
        parameters: Annotated[Optional[StrictStr], Field(description="JSON encoded report parameters")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set filter values for given report

        Set filter values for given report

        :param reportid: Report ID (required)
        :type reportid: int
        :param values: JSON encoded filter values (required)
        :type values: str
        :param parameters: JSON encoded report parameters
        :type parameters: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_set_filters_serialize(
            reportid=reportid,
            values=values,
            parameters=parameters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_set_filters(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        values: Annotated[Optional[StrictStr], Field(description="JSON encoded filter values")],
        parameters: Annotated[Optional[StrictStr], Field(description="JSON encoded report parameters")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Set filter values for given report

        Set filter values for given report

        :param reportid: Report ID (required)
        :type reportid: int
        :param values: JSON encoded filter values (required)
        :type values: str
        :param parameters: JSON encoded report parameters
        :type parameters: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_set_filters_serialize(
            reportid=reportid,
            values=values,
            parameters=parameters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_set_filters_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_set_filters_with_http_info(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        values: Annotated[Optional[StrictStr], Field(description="JSON encoded filter values")],
        parameters: Annotated[Optional[StrictStr], Field(description="JSON encoded report parameters")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Set filter values for given report

        Set filter values for given report

        :param reportid: Report ID (required)
        :type reportid: int
        :param values: JSON encoded filter values (required)
        :type values: str
        :param parameters: JSON encoded report parameters
        :type parameters: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_set_filters_serialize(
            reportid=reportid,
            values=values,
            parameters=parameters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_set_filters_without_preload_content(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        values: Annotated[Optional[StrictStr], Field(description="JSON encoded filter values")],
        parameters: Annotated[Optional[StrictStr], Field(description="JSON encoded report parameters")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set filter values for given report

        Set filter values for given report

        :param reportid: Report ID (required)
        :type reportid: int
        :param values: JSON encoded filter values (required)
        :type values: str
        :param parameters: JSON encoded report parameters
        :type parameters: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_set_filters_serialize(
            reportid=reportid,
            values=values,
            parameters=parameters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_set_filters_serialize(
        self,
        reportid,
        values,
        parameters,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_set_filters'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_set_filters'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_set_filters',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if parameters is not None:
            _form_params += parse_form({'parameters': parameters})
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        if values is not None:
            _form_params += parse_form({'values': values})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_reportbuilder_view_report_args(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger custom report viewed

        Trigger custom report viewed

        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_view_report_serialize(
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderViewReportResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_reportbuilder_view_report(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreReportbuilderViewReportResponse:
        """Trigger custom report viewed

        Trigger custom report viewed

        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_view_report_serialize(
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderViewReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_view_report_from_args(
        self,
        args
    ) -> CoreReportbuilderViewReportResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderViewReportResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_reportbuilder_view_report_with_http_info(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreReportbuilderViewReportResponse]:
        """Trigger custom report viewed

        Trigger custom report viewed

        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_view_report_serialize(
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderViewReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_reportbuilder_view_report_without_preload_content(
        self,
        reportid: Annotated[Optional[StrictInt], Field(description="Report ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger custom report viewed

        Trigger custom report viewed

        :param reportid: Report ID (required)
        :type reportid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_reportbuilder_view_report_serialize(
            reportid=reportid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreReportbuilderViewReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_reportbuilder_view_report_serialize(
        self,
        reportid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_reportbuilder_view_report'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_reportbuilder_view_report'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_reportbuilder_view_report',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if reportid is not None:
            _form_params += parse_form({'reportid': reportid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_role_assign_roles_args(
        self,
        assignments: List[CoreRoleAssignRolesParametersAssignmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Manual role assignments.

        Manual role assignments.

        :param assignments: (required)
        :type assignments: List[CoreRoleAssignRolesParametersAssignmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_role_assign_roles_serialize(
            assignments=assignments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_role_assign_roles(
        self,
        assignments: List[CoreRoleAssignRolesParametersAssignmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Manual role assignments.

        Manual role assignments.

        :param assignments: (required)
        :type assignments: List[CoreRoleAssignRolesParametersAssignmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_role_assign_roles_serialize(
            assignments=assignments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_role_assign_roles_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_role_assign_roles_with_http_info(
        self,
        assignments: List[CoreRoleAssignRolesParametersAssignmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Manual role assignments.

        Manual role assignments.

        :param assignments: (required)
        :type assignments: List[CoreRoleAssignRolesParametersAssignmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_role_assign_roles_serialize(
            assignments=assignments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_role_assign_roles_without_preload_content(
        self,
        assignments: List[CoreRoleAssignRolesParametersAssignmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Manual role assignments.

        Manual role assignments.

        :param assignments: (required)
        :type assignments: List[CoreRoleAssignRolesParametersAssignmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_role_assign_roles_serialize(
            assignments=assignments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_role_assign_roles_serialize(
        self,
        assignments,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'assignments': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_role_assign_roles'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_role_assign_roles'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_role_assign_roles',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignments is not None:
            _form_params += parse_form({'assignments': assignments})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_role_unassign_roles_args(
        self,
        unassignments: List[CoreRoleUnassignRolesParametersUnassignmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Manual role unassignments.

        Manual role unassignments.

        :param unassignments: (required)
        :type unassignments: List[CoreRoleUnassignRolesParametersUnassignmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_role_unassign_roles_serialize(
            unassignments=unassignments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_role_unassign_roles(
        self,
        unassignments: List[CoreRoleUnassignRolesParametersUnassignmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Manual role unassignments.

        Manual role unassignments.

        :param unassignments: (required)
        :type unassignments: List[CoreRoleUnassignRolesParametersUnassignmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_role_unassign_roles_serialize(
            unassignments=unassignments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_role_unassign_roles_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_role_unassign_roles_with_http_info(
        self,
        unassignments: List[CoreRoleUnassignRolesParametersUnassignmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Manual role unassignments.

        Manual role unassignments.

        :param unassignments: (required)
        :type unassignments: List[CoreRoleUnassignRolesParametersUnassignmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_role_unassign_roles_serialize(
            unassignments=unassignments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_role_unassign_roles_without_preload_content(
        self,
        unassignments: List[CoreRoleUnassignRolesParametersUnassignmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Manual role unassignments.

        Manual role unassignments.

        :param unassignments: (required)
        :type unassignments: List[CoreRoleUnassignRolesParametersUnassignmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_role_unassign_roles_serialize(
            unassignments=unassignments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_role_unassign_roles_serialize(
        self,
        unassignments,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'unassignments': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_role_unassign_roles'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_role_unassign_roles'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_role_unassign_roles',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if unassignments is not None:
            _form_params += parse_form({'unassignments': unassignments})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_search_get_relevant_users_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id (0 if none)")],
        query: Annotated[Optional[StrictStr], Field(description="Query string (full or partial user full name or other details)")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Gets relevant users for a search request.

        Gets relevant users for a search request.

        :param courseid: Course id (0 if none) (required)
        :type courseid: int
        :param query: Query string (full or partial user full name or other details) (required)
        :type query: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_get_relevant_users_serialize(
            courseid=courseid,
            query=query,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreSearchGetRelevantUsersResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_search_get_relevant_users(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id (0 if none)")],
        query: Annotated[Optional[StrictStr], Field(description="Query string (full or partial user full name or other details)")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreSearchGetRelevantUsersResponseInner]:
        """Gets relevant users for a search request.

        Gets relevant users for a search request.

        :param courseid: Course id (0 if none) (required)
        :type courseid: int
        :param query: Query string (full or partial user full name or other details) (required)
        :type query: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_get_relevant_users_serialize(
            courseid=courseid,
            query=query,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreSearchGetRelevantUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_search_get_relevant_users_from_args(
        self,
        args
    ) -> List[CoreSearchGetRelevantUsersResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreSearchGetRelevantUsersResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_search_get_relevant_users_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id (0 if none)")],
        query: Annotated[Optional[StrictStr], Field(description="Query string (full or partial user full name or other details)")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreSearchGetRelevantUsersResponseInner]]:
        """Gets relevant users for a search request.

        Gets relevant users for a search request.

        :param courseid: Course id (0 if none) (required)
        :type courseid: int
        :param query: Query string (full or partial user full name or other details) (required)
        :type query: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_get_relevant_users_serialize(
            courseid=courseid,
            query=query,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreSearchGetRelevantUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_search_get_relevant_users_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course id (0 if none)")],
        query: Annotated[Optional[StrictStr], Field(description="Query string (full or partial user full name or other details)")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Gets relevant users for a search request.

        Gets relevant users for a search request.

        :param courseid: Course id (0 if none) (required)
        :type courseid: int
        :param query: Query string (full or partial user full name or other details) (required)
        :type query: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_get_relevant_users_serialize(
            courseid=courseid,
            query=query,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreSearchGetRelevantUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_search_get_relevant_users_serialize(
        self,
        courseid,
        query,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_search_get_relevant_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_search_get_relevant_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_search_get_relevant_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if query is not None:
            _form_params += parse_form({'query': query})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_search_get_results_args(
        self,
        query: Annotated[Optional[StrictStr], Field(description="the search query")],
        filters: Optional[CoreSearchGetResultsParametersFilters] = None,
        page: Annotated[Optional[StrictInt], Field(description="results page number starting from 0, defaults to the first page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get search results.

        Get search results.

        :param query: the search query (required)
        :type query: str
        :param filters:
        :type filters: CoreSearchGetResultsParametersFilters
        :param page: results page number starting from 0, defaults to the first page
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_get_results_serialize(
            query=query,
            filters=filters,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchGetResultsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_search_get_results(
        self,
        query: Annotated[Optional[StrictStr], Field(description="the search query")],
        filters: Optional[CoreSearchGetResultsParametersFilters] = None,
        page: Annotated[Optional[StrictInt], Field(description="results page number starting from 0, defaults to the first page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreSearchGetResultsResponse:
        """Get search results.

        Get search results.

        :param query: the search query (required)
        :type query: str
        :param filters:
        :type filters: CoreSearchGetResultsParametersFilters
        :param page: results page number starting from 0, defaults to the first page
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_get_results_serialize(
            query=query,
            filters=filters,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchGetResultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_search_get_results_from_args(
        self,
        args
    ) -> CoreSearchGetResultsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchGetResultsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_search_get_results_with_http_info(
        self,
        query: Annotated[Optional[StrictStr], Field(description="the search query")],
        filters: Optional[CoreSearchGetResultsParametersFilters] = None,
        page: Annotated[Optional[StrictInt], Field(description="results page number starting from 0, defaults to the first page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreSearchGetResultsResponse]:
        """Get search results.

        Get search results.

        :param query: the search query (required)
        :type query: str
        :param filters:
        :type filters: CoreSearchGetResultsParametersFilters
        :param page: results page number starting from 0, defaults to the first page
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_get_results_serialize(
            query=query,
            filters=filters,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchGetResultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_search_get_results_without_preload_content(
        self,
        query: Annotated[Optional[StrictStr], Field(description="the search query")],
        filters: Optional[CoreSearchGetResultsParametersFilters] = None,
        page: Annotated[Optional[StrictInt], Field(description="results page number starting from 0, defaults to the first page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get search results.

        Get search results.

        :param query: the search query (required)
        :type query: str
        :param filters:
        :type filters: CoreSearchGetResultsParametersFilters
        :param page: results page number starting from 0, defaults to the first page
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_get_results_serialize(
            query=query,
            filters=filters,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchGetResultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_search_get_results_serialize(
        self,
        query,
        filters,
        page,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_search_get_results'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_search_get_results'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_search_get_results',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if filters is not None:
            _form_params += parse_form({'filters': filters})
        if page is not None:
            _form_params += parse_form({'page': page})
        if query is not None:
            _form_params += parse_form({'query': query})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_search_get_search_areas_list_args(
        self,
        cat: Annotated[Optional[StrictStr], Field(description="category to filter areas")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get search areas.

        Get search areas.

        :param cat: category to filter areas
        :type cat: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_get_search_areas_list_serialize(
            cat=cat,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchGetSearchAreasListResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_search_get_search_areas_list(
        self,
        cat: Annotated[Optional[StrictStr], Field(description="category to filter areas")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreSearchGetSearchAreasListResponse:
        """Get search areas.

        Get search areas.

        :param cat: category to filter areas
        :type cat: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_get_search_areas_list_serialize(
            cat=cat,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchGetSearchAreasListResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_search_get_search_areas_list_from_args(
        self,
        args
    ) -> CoreSearchGetSearchAreasListResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchGetSearchAreasListResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_search_get_search_areas_list_with_http_info(
        self,
        cat: Annotated[Optional[StrictStr], Field(description="category to filter areas")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreSearchGetSearchAreasListResponse]:
        """Get search areas.

        Get search areas.

        :param cat: category to filter areas
        :type cat: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_get_search_areas_list_serialize(
            cat=cat,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchGetSearchAreasListResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_search_get_search_areas_list_without_preload_content(
        self,
        cat: Annotated[Optional[StrictStr], Field(description="category to filter areas")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get search areas.

        Get search areas.

        :param cat: category to filter areas
        :type cat: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_get_search_areas_list_serialize(
            cat=cat,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchGetSearchAreasListResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_search_get_search_areas_list_serialize(
        self,
        cat,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_search_get_search_areas_list'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_search_get_search_areas_list'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_search_get_search_areas_list',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cat is not None:
            _form_params += parse_form({'cat': cat})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_search_get_top_results_args(
        self,
        query: Annotated[Optional[StrictStr], Field(description="the search query")],
        filters: Optional[CoreSearchGetResultsParametersFilters] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get top search results.

        Get top search results.

        :param query: the search query (required)
        :type query: str
        :param filters:
        :type filters: CoreSearchGetResultsParametersFilters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_get_top_results_serialize(
            query=query,
            filters=filters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchGetTopResultsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_search_get_top_results(
        self,
        query: Annotated[Optional[StrictStr], Field(description="the search query")],
        filters: Optional[CoreSearchGetResultsParametersFilters] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreSearchGetTopResultsResponse:
        """Get top search results.

        Get top search results.

        :param query: the search query (required)
        :type query: str
        :param filters:
        :type filters: CoreSearchGetResultsParametersFilters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_get_top_results_serialize(
            query=query,
            filters=filters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchGetTopResultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_search_get_top_results_from_args(
        self,
        args
    ) -> CoreSearchGetTopResultsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchGetTopResultsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_search_get_top_results_with_http_info(
        self,
        query: Annotated[Optional[StrictStr], Field(description="the search query")],
        filters: Optional[CoreSearchGetResultsParametersFilters] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreSearchGetTopResultsResponse]:
        """Get top search results.

        Get top search results.

        :param query: the search query (required)
        :type query: str
        :param filters:
        :type filters: CoreSearchGetResultsParametersFilters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_get_top_results_serialize(
            query=query,
            filters=filters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchGetTopResultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_search_get_top_results_without_preload_content(
        self,
        query: Annotated[Optional[StrictStr], Field(description="the search query")],
        filters: Optional[CoreSearchGetResultsParametersFilters] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get top search results.

        Get top search results.

        :param query: the search query (required)
        :type query: str
        :param filters:
        :type filters: CoreSearchGetResultsParametersFilters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_get_top_results_serialize(
            query=query,
            filters=filters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchGetTopResultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_search_get_top_results_serialize(
        self,
        query,
        filters,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_search_get_top_results'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_search_get_top_results'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_search_get_top_results',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if filters is not None:
            _form_params += parse_form({'filters': filters})
        if query is not None:
            _form_params += parse_form({'query': query})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_search_view_results_args(
        self,
        query: Annotated[Optional[StrictStr], Field(description="the search query")],
        filters: Optional[CoreSearchViewResultsParametersFilters] = None,
        page: Annotated[Optional[StrictInt], Field(description="results page number starting from 0, defaults to the first page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger view search results event.

        Trigger view search results event.

        :param query: the search query (required)
        :type query: str
        :param filters:
        :type filters: CoreSearchViewResultsParametersFilters
        :param page: results page number starting from 0, defaults to the first page
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_view_results_serialize(
            query=query,
            filters=filters,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchViewResultsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_search_view_results(
        self,
        query: Annotated[Optional[StrictStr], Field(description="the search query")],
        filters: Optional[CoreSearchViewResultsParametersFilters] = None,
        page: Annotated[Optional[StrictInt], Field(description="results page number starting from 0, defaults to the first page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreSearchViewResultsResponse:
        """Trigger view search results event.

        Trigger view search results event.

        :param query: the search query (required)
        :type query: str
        :param filters:
        :type filters: CoreSearchViewResultsParametersFilters
        :param page: results page number starting from 0, defaults to the first page
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_view_results_serialize(
            query=query,
            filters=filters,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchViewResultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_search_view_results_from_args(
        self,
        args
    ) -> CoreSearchViewResultsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchViewResultsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_search_view_results_with_http_info(
        self,
        query: Annotated[Optional[StrictStr], Field(description="the search query")],
        filters: Optional[CoreSearchViewResultsParametersFilters] = None,
        page: Annotated[Optional[StrictInt], Field(description="results page number starting from 0, defaults to the first page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreSearchViewResultsResponse]:
        """Trigger view search results event.

        Trigger view search results event.

        :param query: the search query (required)
        :type query: str
        :param filters:
        :type filters: CoreSearchViewResultsParametersFilters
        :param page: results page number starting from 0, defaults to the first page
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_view_results_serialize(
            query=query,
            filters=filters,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchViewResultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_search_view_results_without_preload_content(
        self,
        query: Annotated[Optional[StrictStr], Field(description="the search query")],
        filters: Optional[CoreSearchViewResultsParametersFilters] = None,
        page: Annotated[Optional[StrictInt], Field(description="results page number starting from 0, defaults to the first page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger view search results event.

        Trigger view search results event.

        :param query: the search query (required)
        :type query: str
        :param filters:
        :type filters: CoreSearchViewResultsParametersFilters
        :param page: results page number starting from 0, defaults to the first page
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_search_view_results_serialize(
            query=query,
            filters=filters,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSearchViewResultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_search_view_results_serialize(
        self,
        query,
        filters,
        page,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_search_view_results'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_search_view_results'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_search_view_results',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if filters is not None:
            _form_params += parse_form({'filters': filters})
        if page is not None:
            _form_params += parse_form({'page': page})
        if query is not None:
            _form_params += parse_form({'query': query})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_session_time_remaining_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Count the seconds remaining in this session

        Count the seconds remaining in this session

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_session_time_remaining_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSessionTimeRemainingResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_session_time_remaining(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreSessionTimeRemainingResponse:
        """Count the seconds remaining in this session

        Count the seconds remaining in this session

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_session_time_remaining_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSessionTimeRemainingResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_session_time_remaining_from_args(
        self,
        args
    ) -> CoreSessionTimeRemainingResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSessionTimeRemainingResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_session_time_remaining_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreSessionTimeRemainingResponse]:
        """Count the seconds remaining in this session

        Count the seconds remaining in this session

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_session_time_remaining_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSessionTimeRemainingResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_session_time_remaining_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Count the seconds remaining in this session

        Count the seconds remaining in this session

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_session_time_remaining_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSessionTimeRemainingResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_session_time_remaining_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_session_time_remaining'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_session_time_remaining'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_session_time_remaining',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_session_touch_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Keep the users session alive

        Keep the users session alive

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_session_touch_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_session_touch(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Keep the users session alive

        Keep the users session alive

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_session_touch_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_session_touch_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_session_touch_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Keep the users session alive

        Keep the users session alive

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_session_touch_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_session_touch_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Keep the users session alive

        Keep the users session alive

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_session_touch_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_session_touch_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_session_touch'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_session_touch'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_session_touch',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_sms_set_gateway_status_args(
        self,
        plugin: Annotated[Optional[StrictInt], Field(description="Gateway ID")],
        state: Annotated[Optional[StrictInt], Field(description="Enabled or disabled")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set the sms gateway status

        Set the sms gateway status

        :param plugin: Gateway ID (required)
        :type plugin: int
        :param state: Enabled or disabled (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_sms_set_gateway_status_serialize(
            plugin=plugin,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSmsSetGatewayStatusResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_sms_set_gateway_status(
        self,
        plugin: Annotated[Optional[StrictInt], Field(description="Gateway ID")],
        state: Annotated[Optional[StrictInt], Field(description="Enabled or disabled")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreSmsSetGatewayStatusResponse:
        """Set the sms gateway status

        Set the sms gateway status

        :param plugin: Gateway ID (required)
        :type plugin: int
        :param state: Enabled or disabled (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_sms_set_gateway_status_serialize(
            plugin=plugin,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSmsSetGatewayStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_sms_set_gateway_status_from_args(
        self,
        args
    ) -> CoreSmsSetGatewayStatusResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSmsSetGatewayStatusResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_sms_set_gateway_status_with_http_info(
        self,
        plugin: Annotated[Optional[StrictInt], Field(description="Gateway ID")],
        state: Annotated[Optional[StrictInt], Field(description="Enabled or disabled")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreSmsSetGatewayStatusResponse]:
        """Set the sms gateway status

        Set the sms gateway status

        :param plugin: Gateway ID (required)
        :type plugin: int
        :param state: Enabled or disabled (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_sms_set_gateway_status_serialize(
            plugin=plugin,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSmsSetGatewayStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_sms_set_gateway_status_without_preload_content(
        self,
        plugin: Annotated[Optional[StrictInt], Field(description="Gateway ID")],
        state: Annotated[Optional[StrictInt], Field(description="Enabled or disabled")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set the sms gateway status

        Set the sms gateway status

        :param plugin: Gateway ID (required)
        :type plugin: int
        :param state: Enabled or disabled (required)
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_sms_set_gateway_status_serialize(
            plugin=plugin,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreSmsSetGatewayStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_sms_set_gateway_status_serialize(
        self,
        plugin,
        state,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_sms_set_gateway_status'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_sms_set_gateway_status'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_sms_set_gateway_status',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if plugin is not None:
            _form_params += parse_form({'plugin': plugin})
        if state is not None:
            _form_params += parse_form({'state': state})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_table_get_dynamic_table_content_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component")],
        firstinitial: Annotated[Optional[StrictStr], Field(description="The first initial to sort filter on")],
        handler: Annotated[Optional[StrictStr], Field(description="Handler")],
        hiddencolumns: List[Optional[StrictStr]],
        jointype: Annotated[Optional[StrictInt], Field(description="Type of join to join all filters together")],
        lastinitial: Annotated[Optional[StrictStr], Field(description="The last initial to sort filter on")],
        pagenumber: Annotated[Optional[StrictInt], Field(description="The page number")],
        pagesize: Annotated[Optional[StrictInt], Field(description="The number of records per page")],
        resetpreferences: Annotated[Optional[StrictBool], Field(description="Whether the table preferences should be reset")],
        uniqueid: Annotated[Optional[StrictStr], Field(description="Unique ID for the container")],
        filters: Annotated[Optional[List[CoreTableGetDynamicTableContentParametersFiltersInner]], Field(description="The filters that will be applied in the request")] = None,
        sortdata: Annotated[Optional[List[CoreTableGetDynamicTableContentParametersSortdataInner]], Field(description="The combined sort order of the table. Multiple fields can be specified.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the dynamic table content raw html

        Get the dynamic table content raw html

        :param component: Component (required)
        :type component: str
        :param firstinitial: The first initial to sort filter on (required)
        :type firstinitial: str
        :param handler: Handler (required)
        :type handler: str
        :param hiddencolumns: (required)
        :type hiddencolumns: List[Optional[str]]
        :param jointype: Type of join to join all filters together (required)
        :type jointype: int
        :param lastinitial: The last initial to sort filter on (required)
        :type lastinitial: str
        :param pagenumber: The page number (required)
        :type pagenumber: int
        :param pagesize: The number of records per page (required)
        :type pagesize: int
        :param resetpreferences: Whether the table preferences should be reset (required)
        :type resetpreferences: bool
        :param uniqueid: Unique ID for the container (required)
        :type uniqueid: str
        :param filters: The filters that will be applied in the request
        :type filters: List[CoreTableGetDynamicTableContentParametersFiltersInner]
        :param sortdata: The combined sort order of the table. Multiple fields can be specified.
        :type sortdata: List[CoreTableGetDynamicTableContentParametersSortdataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_table_get_dynamic_table_content_serialize(
            component=component,
            firstinitial=firstinitial,
            handler=handler,
            hiddencolumns=hiddencolumns,
            jointype=jointype,
            lastinitial=lastinitial,
            pagenumber=pagenumber,
            pagesize=pagesize,
            resetpreferences=resetpreferences,
            uniqueid=uniqueid,
            filters=filters,
            sortdata=sortdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTableGetDynamicTableContentResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_table_get_dynamic_table_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component")],
        firstinitial: Annotated[Optional[StrictStr], Field(description="The first initial to sort filter on")],
        handler: Annotated[Optional[StrictStr], Field(description="Handler")],
        hiddencolumns: List[Optional[StrictStr]],
        jointype: Annotated[Optional[StrictInt], Field(description="Type of join to join all filters together")],
        lastinitial: Annotated[Optional[StrictStr], Field(description="The last initial to sort filter on")],
        pagenumber: Annotated[Optional[StrictInt], Field(description="The page number")],
        pagesize: Annotated[Optional[StrictInt], Field(description="The number of records per page")],
        resetpreferences: Annotated[Optional[StrictBool], Field(description="Whether the table preferences should be reset")],
        uniqueid: Annotated[Optional[StrictStr], Field(description="Unique ID for the container")],
        filters: Annotated[Optional[List[CoreTableGetDynamicTableContentParametersFiltersInner]], Field(description="The filters that will be applied in the request")] = None,
        sortdata: Annotated[Optional[List[CoreTableGetDynamicTableContentParametersSortdataInner]], Field(description="The combined sort order of the table. Multiple fields can be specified.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreTableGetDynamicTableContentResponse:
        """Get the dynamic table content raw html

        Get the dynamic table content raw html

        :param component: Component (required)
        :type component: str
        :param firstinitial: The first initial to sort filter on (required)
        :type firstinitial: str
        :param handler: Handler (required)
        :type handler: str
        :param hiddencolumns: (required)
        :type hiddencolumns: List[Optional[str]]
        :param jointype: Type of join to join all filters together (required)
        :type jointype: int
        :param lastinitial: The last initial to sort filter on (required)
        :type lastinitial: str
        :param pagenumber: The page number (required)
        :type pagenumber: int
        :param pagesize: The number of records per page (required)
        :type pagesize: int
        :param resetpreferences: Whether the table preferences should be reset (required)
        :type resetpreferences: bool
        :param uniqueid: Unique ID for the container (required)
        :type uniqueid: str
        :param filters: The filters that will be applied in the request
        :type filters: List[CoreTableGetDynamicTableContentParametersFiltersInner]
        :param sortdata: The combined sort order of the table. Multiple fields can be specified.
        :type sortdata: List[CoreTableGetDynamicTableContentParametersSortdataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_table_get_dynamic_table_content_serialize(
            component=component,
            firstinitial=firstinitial,
            handler=handler,
            hiddencolumns=hiddencolumns,
            jointype=jointype,
            lastinitial=lastinitial,
            pagenumber=pagenumber,
            pagesize=pagesize,
            resetpreferences=resetpreferences,
            uniqueid=uniqueid,
            filters=filters,
            sortdata=sortdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTableGetDynamicTableContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_table_get_dynamic_table_content_from_args(
        self,
        args
    ) -> CoreTableGetDynamicTableContentResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTableGetDynamicTableContentResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_table_get_dynamic_table_content_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component")],
        firstinitial: Annotated[Optional[StrictStr], Field(description="The first initial to sort filter on")],
        handler: Annotated[Optional[StrictStr], Field(description="Handler")],
        hiddencolumns: List[Optional[StrictStr]],
        jointype: Annotated[Optional[StrictInt], Field(description="Type of join to join all filters together")],
        lastinitial: Annotated[Optional[StrictStr], Field(description="The last initial to sort filter on")],
        pagenumber: Annotated[Optional[StrictInt], Field(description="The page number")],
        pagesize: Annotated[Optional[StrictInt], Field(description="The number of records per page")],
        resetpreferences: Annotated[Optional[StrictBool], Field(description="Whether the table preferences should be reset")],
        uniqueid: Annotated[Optional[StrictStr], Field(description="Unique ID for the container")],
        filters: Annotated[Optional[List[CoreTableGetDynamicTableContentParametersFiltersInner]], Field(description="The filters that will be applied in the request")] = None,
        sortdata: Annotated[Optional[List[CoreTableGetDynamicTableContentParametersSortdataInner]], Field(description="The combined sort order of the table. Multiple fields can be specified.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreTableGetDynamicTableContentResponse]:
        """Get the dynamic table content raw html

        Get the dynamic table content raw html

        :param component: Component (required)
        :type component: str
        :param firstinitial: The first initial to sort filter on (required)
        :type firstinitial: str
        :param handler: Handler (required)
        :type handler: str
        :param hiddencolumns: (required)
        :type hiddencolumns: List[Optional[str]]
        :param jointype: Type of join to join all filters together (required)
        :type jointype: int
        :param lastinitial: The last initial to sort filter on (required)
        :type lastinitial: str
        :param pagenumber: The page number (required)
        :type pagenumber: int
        :param pagesize: The number of records per page (required)
        :type pagesize: int
        :param resetpreferences: Whether the table preferences should be reset (required)
        :type resetpreferences: bool
        :param uniqueid: Unique ID for the container (required)
        :type uniqueid: str
        :param filters: The filters that will be applied in the request
        :type filters: List[CoreTableGetDynamicTableContentParametersFiltersInner]
        :param sortdata: The combined sort order of the table. Multiple fields can be specified.
        :type sortdata: List[CoreTableGetDynamicTableContentParametersSortdataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_table_get_dynamic_table_content_serialize(
            component=component,
            firstinitial=firstinitial,
            handler=handler,
            hiddencolumns=hiddencolumns,
            jointype=jointype,
            lastinitial=lastinitial,
            pagenumber=pagenumber,
            pagesize=pagesize,
            resetpreferences=resetpreferences,
            uniqueid=uniqueid,
            filters=filters,
            sortdata=sortdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTableGetDynamicTableContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_table_get_dynamic_table_content_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component")],
        firstinitial: Annotated[Optional[StrictStr], Field(description="The first initial to sort filter on")],
        handler: Annotated[Optional[StrictStr], Field(description="Handler")],
        hiddencolumns: List[Optional[StrictStr]],
        jointype: Annotated[Optional[StrictInt], Field(description="Type of join to join all filters together")],
        lastinitial: Annotated[Optional[StrictStr], Field(description="The last initial to sort filter on")],
        pagenumber: Annotated[Optional[StrictInt], Field(description="The page number")],
        pagesize: Annotated[Optional[StrictInt], Field(description="The number of records per page")],
        resetpreferences: Annotated[Optional[StrictBool], Field(description="Whether the table preferences should be reset")],
        uniqueid: Annotated[Optional[StrictStr], Field(description="Unique ID for the container")],
        filters: Annotated[Optional[List[CoreTableGetDynamicTableContentParametersFiltersInner]], Field(description="The filters that will be applied in the request")] = None,
        sortdata: Annotated[Optional[List[CoreTableGetDynamicTableContentParametersSortdataInner]], Field(description="The combined sort order of the table. Multiple fields can be specified.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the dynamic table content raw html

        Get the dynamic table content raw html

        :param component: Component (required)
        :type component: str
        :param firstinitial: The first initial to sort filter on (required)
        :type firstinitial: str
        :param handler: Handler (required)
        :type handler: str
        :param hiddencolumns: (required)
        :type hiddencolumns: List[Optional[str]]
        :param jointype: Type of join to join all filters together (required)
        :type jointype: int
        :param lastinitial: The last initial to sort filter on (required)
        :type lastinitial: str
        :param pagenumber: The page number (required)
        :type pagenumber: int
        :param pagesize: The number of records per page (required)
        :type pagesize: int
        :param resetpreferences: Whether the table preferences should be reset (required)
        :type resetpreferences: bool
        :param uniqueid: Unique ID for the container (required)
        :type uniqueid: str
        :param filters: The filters that will be applied in the request
        :type filters: List[CoreTableGetDynamicTableContentParametersFiltersInner]
        :param sortdata: The combined sort order of the table. Multiple fields can be specified.
        :type sortdata: List[CoreTableGetDynamicTableContentParametersSortdataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_table_get_dynamic_table_content_serialize(
            component=component,
            firstinitial=firstinitial,
            handler=handler,
            hiddencolumns=hiddencolumns,
            jointype=jointype,
            lastinitial=lastinitial,
            pagenumber=pagenumber,
            pagesize=pagesize,
            resetpreferences=resetpreferences,
            uniqueid=uniqueid,
            filters=filters,
            sortdata=sortdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTableGetDynamicTableContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_table_get_dynamic_table_content_serialize(
        self,
        component,
        firstinitial,
        handler,
        hiddencolumns,
        jointype,
        lastinitial,
        pagenumber,
        pagesize,
        resetpreferences,
        uniqueid,
        filters,
        sortdata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'hiddencolumns': 'csv',
            'filters': 'csv',
            'sortdata': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_table_get_dynamic_table_content'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_table_get_dynamic_table_content'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_table_get_dynamic_table_content',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if component is not None:
            _form_params += parse_form({'component': component})
        if filters is not None:
            _form_params += parse_form({'filters': filters})
        if firstinitial is not None:
            _form_params += parse_form({'firstinitial': firstinitial})
        if handler is not None:
            _form_params += parse_form({'handler': handler})
        if hiddencolumns is not None:
            _form_params += parse_form({'hiddencolumns': hiddencolumns})
        if jointype is not None:
            _form_params += parse_form({'jointype': jointype})
        if lastinitial is not None:
            _form_params += parse_form({'lastinitial': lastinitial})
        if pagenumber is not None:
            _form_params += parse_form({'pagenumber': pagenumber})
        if pagesize is not None:
            _form_params += parse_form({'pagesize': pagesize})
        if resetpreferences is not None:
            _form_params += parse_form({'resetpreferences': resetpreferences})
        if sortdata is not None:
            _form_params += parse_form({'sortdata': sortdata})
        if uniqueid is not None:
            _form_params += parse_form({'uniqueid': uniqueid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_tag_get_tag_areas_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves existing tag areas.

        Retrieves existing tag areas.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tag_areas_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagAreasResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_tag_get_tag_areas(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreTagGetTagAreasResponse:
        """Retrieves existing tag areas.

        Retrieves existing tag areas.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tag_areas_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagAreasResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_tag_get_tag_areas_from_args(
        self,
        args
    ) -> CoreTagGetTagAreasResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagAreasResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_tag_get_tag_areas_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreTagGetTagAreasResponse]:
        """Retrieves existing tag areas.

        Retrieves existing tag areas.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tag_areas_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagAreasResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_tag_get_tag_areas_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves existing tag areas.

        Retrieves existing tag areas.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tag_areas_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagAreasResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_tag_get_tag_areas_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_tag_get_tag_areas'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_tag_get_tag_areas'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_tag_get_tag_areas',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_tag_get_tag_cloud_args(
        self,
        ctx: Annotated[Optional[StrictInt], Field(description="Only retrieve tag instances in this context.")] = None,
        fromctx: Annotated[Optional[StrictInt], Field(description="Context id where this tag cloud is displayed.")] = None,
        isstandard: Annotated[Optional[StrictBool], Field(description="Whether to return only standard tags.")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Maximum number of tags to retrieve.")] = None,
        rec: Annotated[Optional[StrictInt], Field(description="Retrieve tag instances in the $ctx context and it's children.")] = None,
        search: Annotated[Optional[StrictStr], Field(description="Search string.")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort order for display                     (id, name, rawname, count, flag, isstandard, tagcollid).")] = None,
        tagcollid: Annotated[Optional[StrictInt], Field(description="Tag collection id.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves a tag cloud for the given collection and/or query search.

        Retrieves a tag cloud for the given collection and/or query search.

        :param ctx: Only retrieve tag instances in this context.
        :type ctx: int
        :param fromctx: Context id where this tag cloud is displayed.
        :type fromctx: int
        :param isstandard: Whether to return only standard tags.
        :type isstandard: bool
        :param limit: Maximum number of tags to retrieve.
        :type limit: int
        :param rec: Retrieve tag instances in the $ctx context and it's children.
        :type rec: int
        :param search: Search string.
        :type search: str
        :param sort: Sort order for display                     (id, name, rawname, count, flag, isstandard, tagcollid).
        :type sort: str
        :param tagcollid: Tag collection id.
        :type tagcollid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tag_cloud_serialize(
            ctx=ctx,
            fromctx=fromctx,
            isstandard=isstandard,
            limit=limit,
            rec=rec,
            search=search,
            sort=sort,
            tagcollid=tagcollid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagCloudResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_tag_get_tag_cloud(
        self,
        ctx: Annotated[Optional[StrictInt], Field(description="Only retrieve tag instances in this context.")] = None,
        fromctx: Annotated[Optional[StrictInt], Field(description="Context id where this tag cloud is displayed.")] = None,
        isstandard: Annotated[Optional[StrictBool], Field(description="Whether to return only standard tags.")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Maximum number of tags to retrieve.")] = None,
        rec: Annotated[Optional[StrictInt], Field(description="Retrieve tag instances in the $ctx context and it's children.")] = None,
        search: Annotated[Optional[StrictStr], Field(description="Search string.")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort order for display                     (id, name, rawname, count, flag, isstandard, tagcollid).")] = None,
        tagcollid: Annotated[Optional[StrictInt], Field(description="Tag collection id.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreTagGetTagCloudResponse:
        """Retrieves a tag cloud for the given collection and/or query search.

        Retrieves a tag cloud for the given collection and/or query search.

        :param ctx: Only retrieve tag instances in this context.
        :type ctx: int
        :param fromctx: Context id where this tag cloud is displayed.
        :type fromctx: int
        :param isstandard: Whether to return only standard tags.
        :type isstandard: bool
        :param limit: Maximum number of tags to retrieve.
        :type limit: int
        :param rec: Retrieve tag instances in the $ctx context and it's children.
        :type rec: int
        :param search: Search string.
        :type search: str
        :param sort: Sort order for display                     (id, name, rawname, count, flag, isstandard, tagcollid).
        :type sort: str
        :param tagcollid: Tag collection id.
        :type tagcollid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tag_cloud_serialize(
            ctx=ctx,
            fromctx=fromctx,
            isstandard=isstandard,
            limit=limit,
            rec=rec,
            search=search,
            sort=sort,
            tagcollid=tagcollid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagCloudResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_tag_get_tag_cloud_from_args(
        self,
        args
    ) -> CoreTagGetTagCloudResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagCloudResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_tag_get_tag_cloud_with_http_info(
        self,
        ctx: Annotated[Optional[StrictInt], Field(description="Only retrieve tag instances in this context.")] = None,
        fromctx: Annotated[Optional[StrictInt], Field(description="Context id where this tag cloud is displayed.")] = None,
        isstandard: Annotated[Optional[StrictBool], Field(description="Whether to return only standard tags.")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Maximum number of tags to retrieve.")] = None,
        rec: Annotated[Optional[StrictInt], Field(description="Retrieve tag instances in the $ctx context and it's children.")] = None,
        search: Annotated[Optional[StrictStr], Field(description="Search string.")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort order for display                     (id, name, rawname, count, flag, isstandard, tagcollid).")] = None,
        tagcollid: Annotated[Optional[StrictInt], Field(description="Tag collection id.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreTagGetTagCloudResponse]:
        """Retrieves a tag cloud for the given collection and/or query search.

        Retrieves a tag cloud for the given collection and/or query search.

        :param ctx: Only retrieve tag instances in this context.
        :type ctx: int
        :param fromctx: Context id where this tag cloud is displayed.
        :type fromctx: int
        :param isstandard: Whether to return only standard tags.
        :type isstandard: bool
        :param limit: Maximum number of tags to retrieve.
        :type limit: int
        :param rec: Retrieve tag instances in the $ctx context and it's children.
        :type rec: int
        :param search: Search string.
        :type search: str
        :param sort: Sort order for display                     (id, name, rawname, count, flag, isstandard, tagcollid).
        :type sort: str
        :param tagcollid: Tag collection id.
        :type tagcollid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tag_cloud_serialize(
            ctx=ctx,
            fromctx=fromctx,
            isstandard=isstandard,
            limit=limit,
            rec=rec,
            search=search,
            sort=sort,
            tagcollid=tagcollid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagCloudResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_tag_get_tag_cloud_without_preload_content(
        self,
        ctx: Annotated[Optional[StrictInt], Field(description="Only retrieve tag instances in this context.")] = None,
        fromctx: Annotated[Optional[StrictInt], Field(description="Context id where this tag cloud is displayed.")] = None,
        isstandard: Annotated[Optional[StrictBool], Field(description="Whether to return only standard tags.")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Maximum number of tags to retrieve.")] = None,
        rec: Annotated[Optional[StrictInt], Field(description="Retrieve tag instances in the $ctx context and it's children.")] = None,
        search: Annotated[Optional[StrictStr], Field(description="Search string.")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort order for display                     (id, name, rawname, count, flag, isstandard, tagcollid).")] = None,
        tagcollid: Annotated[Optional[StrictInt], Field(description="Tag collection id.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves a tag cloud for the given collection and/or query search.

        Retrieves a tag cloud for the given collection and/or query search.

        :param ctx: Only retrieve tag instances in this context.
        :type ctx: int
        :param fromctx: Context id where this tag cloud is displayed.
        :type fromctx: int
        :param isstandard: Whether to return only standard tags.
        :type isstandard: bool
        :param limit: Maximum number of tags to retrieve.
        :type limit: int
        :param rec: Retrieve tag instances in the $ctx context and it's children.
        :type rec: int
        :param search: Search string.
        :type search: str
        :param sort: Sort order for display                     (id, name, rawname, count, flag, isstandard, tagcollid).
        :type sort: str
        :param tagcollid: Tag collection id.
        :type tagcollid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tag_cloud_serialize(
            ctx=ctx,
            fromctx=fromctx,
            isstandard=isstandard,
            limit=limit,
            rec=rec,
            search=search,
            sort=sort,
            tagcollid=tagcollid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagCloudResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_tag_get_tag_cloud_serialize(
        self,
        ctx,
        fromctx,
        isstandard,
        limit,
        rec,
        search,
        sort,
        tagcollid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_tag_get_tag_cloud'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_tag_get_tag_cloud'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_tag_get_tag_cloud',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if ctx is not None:
            _form_params += parse_form({'ctx': ctx})
        if fromctx is not None:
            _form_params += parse_form({'fromctx': fromctx})
        if isstandard is not None:
            _form_params += parse_form({'isstandard': isstandard})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if rec is not None:
            _form_params += parse_form({'rec': rec})
        if search is not None:
            _form_params += parse_form({'search': search})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        if tagcollid is not None:
            _form_params += parse_form({'tagcollid': tagcollid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_tag_get_tag_collections_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves existing tag collections.

        Retrieves existing tag collections.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tag_collections_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagCollectionsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_tag_get_tag_collections(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreTagGetTagCollectionsResponse:
        """Retrieves existing tag collections.

        Retrieves existing tag collections.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tag_collections_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagCollectionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_tag_get_tag_collections_from_args(
        self,
        args
    ) -> CoreTagGetTagCollectionsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagCollectionsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_tag_get_tag_collections_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreTagGetTagCollectionsResponse]:
        """Retrieves existing tag collections.

        Retrieves existing tag collections.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tag_collections_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagCollectionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_tag_get_tag_collections_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves existing tag collections.

        Retrieves existing tag collections.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tag_collections_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagCollectionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_tag_get_tag_collections_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_tag_get_tag_collections'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_tag_get_tag_collections'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_tag_get_tag_collections',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_tag_get_tagindex_args(
        self,
        tagindex: CoreTagGetTagindexParametersTagindex,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Gets tag index page for one tag and one tag area

        Gets tag index page for one tag and one tag area

        :param tagindex: (required)
        :type tagindex: CoreTagGetTagindexParametersTagindex
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tagindex_serialize(
            tagindex=tagindex,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagindexResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_tag_get_tagindex(
        self,
        tagindex: CoreTagGetTagindexParametersTagindex,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreTagGetTagindexResponse:
        """Gets tag index page for one tag and one tag area

        Gets tag index page for one tag and one tag area

        :param tagindex: (required)
        :type tagindex: CoreTagGetTagindexParametersTagindex
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tagindex_serialize(
            tagindex=tagindex,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagindexResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_tag_get_tagindex_from_args(
        self,
        args
    ) -> CoreTagGetTagindexResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagindexResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_tag_get_tagindex_with_http_info(
        self,
        tagindex: CoreTagGetTagindexParametersTagindex,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreTagGetTagindexResponse]:
        """Gets tag index page for one tag and one tag area

        Gets tag index page for one tag and one tag area

        :param tagindex: (required)
        :type tagindex: CoreTagGetTagindexParametersTagindex
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tagindex_serialize(
            tagindex=tagindex,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagindexResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_tag_get_tagindex_without_preload_content(
        self,
        tagindex: CoreTagGetTagindexParametersTagindex,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Gets tag index page for one tag and one tag area

        Gets tag index page for one tag and one tag area

        :param tagindex: (required)
        :type tagindex: CoreTagGetTagindexParametersTagindex
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tagindex_serialize(
            tagindex=tagindex,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagindexResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_tag_get_tagindex_serialize(
        self,
        tagindex,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_tag_get_tagindex'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_tag_get_tagindex'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_tag_get_tagindex',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if tagindex is not None:
            _form_params += parse_form({'tagindex': tagindex})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_tag_get_tagindex_per_area_args(
        self,
        tagindex: CoreTagGetTagindexPerAreaParametersTagindex,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Gets tag index page per different areas.

        Gets tag index page per different areas.

        :param tagindex: (required)
        :type tagindex: CoreTagGetTagindexPerAreaParametersTagindex
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tagindex_per_area_serialize(
            tagindex=tagindex,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreTagGetTagindexPerAreaResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_tag_get_tagindex_per_area(
        self,
        tagindex: CoreTagGetTagindexPerAreaParametersTagindex,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreTagGetTagindexPerAreaResponseInner]:
        """Gets tag index page per different areas.

        Gets tag index page per different areas.

        :param tagindex: (required)
        :type tagindex: CoreTagGetTagindexPerAreaParametersTagindex
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tagindex_per_area_serialize(
            tagindex=tagindex,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreTagGetTagindexPerAreaResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_tag_get_tagindex_per_area_from_args(
        self,
        args
    ) -> List[CoreTagGetTagindexPerAreaResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreTagGetTagindexPerAreaResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_tag_get_tagindex_per_area_with_http_info(
        self,
        tagindex: CoreTagGetTagindexPerAreaParametersTagindex,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreTagGetTagindexPerAreaResponseInner]]:
        """Gets tag index page per different areas.

        Gets tag index page per different areas.

        :param tagindex: (required)
        :type tagindex: CoreTagGetTagindexPerAreaParametersTagindex
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tagindex_per_area_serialize(
            tagindex=tagindex,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreTagGetTagindexPerAreaResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_tag_get_tagindex_per_area_without_preload_content(
        self,
        tagindex: CoreTagGetTagindexPerAreaParametersTagindex,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Gets tag index page per different areas.

        Gets tag index page per different areas.

        :param tagindex: (required)
        :type tagindex: CoreTagGetTagindexPerAreaParametersTagindex
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tagindex_per_area_serialize(
            tagindex=tagindex,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreTagGetTagindexPerAreaResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_tag_get_tagindex_per_area_serialize(
        self,
        tagindex,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_tag_get_tagindex_per_area'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_tag_get_tagindex_per_area'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_tag_get_tagindex_per_area',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if tagindex is not None:
            _form_params += parse_form({'tagindex': tagindex})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_tag_get_tags_args(
        self,
        tags: List[CoreTagGetTagsParametersTagsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Gets tags by their ids

        Gets tags by their ids

        :param tags: (required)
        :type tags: List[CoreTagGetTagsParametersTagsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tags_serialize(
            tags=tags,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_tag_get_tags(
        self,
        tags: List[CoreTagGetTagsParametersTagsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreTagGetTagsResponse:
        """Gets tags by their ids

        Gets tags by their ids

        :param tags: (required)
        :type tags: List[CoreTagGetTagsParametersTagsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tags_serialize(
            tags=tags,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_tag_get_tags_from_args(
        self,
        args
    ) -> CoreTagGetTagsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_tag_get_tags_with_http_info(
        self,
        tags: List[CoreTagGetTagsParametersTagsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreTagGetTagsResponse]:
        """Gets tags by their ids

        Gets tags by their ids

        :param tags: (required)
        :type tags: List[CoreTagGetTagsParametersTagsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tags_serialize(
            tags=tags,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_tag_get_tags_without_preload_content(
        self,
        tags: List[CoreTagGetTagsParametersTagsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Gets tags by their ids

        Gets tags by their ids

        :param tags: (required)
        :type tags: List[CoreTagGetTagsParametersTagsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_get_tags_serialize(
            tags=tags,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagGetTagsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_tag_get_tags_serialize(
        self,
        tags,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'tags': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_tag_get_tags'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_tag_get_tags'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_tag_get_tags',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if tags is not None:
            _form_params += parse_form({'tags': tags})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_tag_update_tags_args(
        self,
        tags: List[CoreTagUpdateTagsParametersTagsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Updates tags

        Updates tags

        :param tags: (required)
        :type tags: List[CoreTagUpdateTagsParametersTagsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_update_tags_serialize(
            tags=tags,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagUpdateTagsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_tag_update_tags(
        self,
        tags: List[CoreTagUpdateTagsParametersTagsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreTagUpdateTagsResponse:
        """Updates tags

        Updates tags

        :param tags: (required)
        :type tags: List[CoreTagUpdateTagsParametersTagsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_update_tags_serialize(
            tags=tags,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagUpdateTagsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_tag_update_tags_from_args(
        self,
        args
    ) -> CoreTagUpdateTagsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagUpdateTagsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_tag_update_tags_with_http_info(
        self,
        tags: List[CoreTagUpdateTagsParametersTagsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreTagUpdateTagsResponse]:
        """Updates tags

        Updates tags

        :param tags: (required)
        :type tags: List[CoreTagUpdateTagsParametersTagsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_update_tags_serialize(
            tags=tags,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagUpdateTagsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_tag_update_tags_without_preload_content(
        self,
        tags: List[CoreTagUpdateTagsParametersTagsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Updates tags

        Updates tags

        :param tags: (required)
        :type tags: List[CoreTagUpdateTagsParametersTagsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_tag_update_tags_serialize(
            tags=tags,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreTagUpdateTagsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_tag_update_tags_serialize(
        self,
        tags,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'tags': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_tag_update_tags'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_tag_update_tags'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_tag_update_tags',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if tags is not None:
            _form_params += parse_form({'tags': tags})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_update_inplace_editable_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component responsible for the update")],
        itemid: Annotated[Optional[StrictStr], Field(description="identifier of the updated item")],
        itemtype: Annotated[Optional[StrictStr], Field(description="type of the updated item inside the component")],
        value: Annotated[Optional[StrictStr], Field(description="new value")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Generic service to update title

        Generic service to update title

        :param component: component responsible for the update (required)
        :type component: str
        :param itemid: identifier of the updated item (required)
        :type itemid: str
        :param itemtype: type of the updated item inside the component (required)
        :type itemtype: str
        :param value: new value (required)
        :type value: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_update_inplace_editable_serialize(
            component=component,
            itemid=itemid,
            itemtype=itemtype,
            value=value,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUpdateInplaceEditableResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_update_inplace_editable(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component responsible for the update")],
        itemid: Annotated[Optional[StrictStr], Field(description="identifier of the updated item")],
        itemtype: Annotated[Optional[StrictStr], Field(description="type of the updated item inside the component")],
        value: Annotated[Optional[StrictStr], Field(description="new value")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreUpdateInplaceEditableResponse:
        """Generic service to update title

        Generic service to update title

        :param component: component responsible for the update (required)
        :type component: str
        :param itemid: identifier of the updated item (required)
        :type itemid: str
        :param itemtype: type of the updated item inside the component (required)
        :type itemtype: str
        :param value: new value (required)
        :type value: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_update_inplace_editable_serialize(
            component=component,
            itemid=itemid,
            itemtype=itemtype,
            value=value,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUpdateInplaceEditableResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_update_inplace_editable_from_args(
        self,
        args
    ) -> CoreUpdateInplaceEditableResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUpdateInplaceEditableResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_update_inplace_editable_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component responsible for the update")],
        itemid: Annotated[Optional[StrictStr], Field(description="identifier of the updated item")],
        itemtype: Annotated[Optional[StrictStr], Field(description="type of the updated item inside the component")],
        value: Annotated[Optional[StrictStr], Field(description="new value")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreUpdateInplaceEditableResponse]:
        """Generic service to update title

        Generic service to update title

        :param component: component responsible for the update (required)
        :type component: str
        :param itemid: identifier of the updated item (required)
        :type itemid: str
        :param itemtype: type of the updated item inside the component (required)
        :type itemtype: str
        :param value: new value (required)
        :type value: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_update_inplace_editable_serialize(
            component=component,
            itemid=itemid,
            itemtype=itemtype,
            value=value,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUpdateInplaceEditableResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_update_inplace_editable_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="component responsible for the update")],
        itemid: Annotated[Optional[StrictStr], Field(description="identifier of the updated item")],
        itemtype: Annotated[Optional[StrictStr], Field(description="type of the updated item inside the component")],
        value: Annotated[Optional[StrictStr], Field(description="new value")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Generic service to update title

        Generic service to update title

        :param component: component responsible for the update (required)
        :type component: str
        :param itemid: identifier of the updated item (required)
        :type itemid: str
        :param itemtype: type of the updated item inside the component (required)
        :type itemtype: str
        :param value: new value (required)
        :type value: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_update_inplace_editable_serialize(
            component=component,
            itemid=itemid,
            itemtype=itemtype,
            value=value,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUpdateInplaceEditableResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_update_inplace_editable_serialize(
        self,
        component,
        itemid,
        itemtype,
        value,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_update_inplace_editable'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_update_inplace_editable'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_update_inplace_editable',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if component is not None:
            _form_params += parse_form({'component': component})
        if itemid is not None:
            _form_params += parse_form({'itemid': itemid})
        if itemtype is not None:
            _form_params += parse_form({'itemtype': itemtype})
        if value is not None:
            _form_params += parse_form({'value': value})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_add_user_device_args(
        self,
        appid: Annotated[Optional[StrictStr], Field(description="the app id, usually something like com.moodle.moodlemobile")],
        model: Annotated[Optional[StrictStr], Field(description="the device model 'Nexus4' or 'iPad1,1' etc.")],
        name: Annotated[Optional[StrictStr], Field(description="the device name, 'occam' or 'iPhone' etc.")],
        platform: Annotated[Optional[StrictStr], Field(description="the device platform 'iOS' or 'Android' etc.")],
        pushid: Annotated[Optional[StrictStr], Field(description="the device PUSH token/key/identifier/registration id")],
        uuid: Annotated[Optional[StrictStr], Field(description="the device UUID")],
        version: Annotated[Optional[StrictStr], Field(description="the device version '6.1.2' or '4.2.2' etc.")],
        publickey: Annotated[Optional[StrictStr], Field(description="the app generated public key")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Store mobile user devices information for PUSH Notifications.

        Store mobile user devices information for PUSH Notifications.

        :param appid: the app id, usually something like com.moodle.moodlemobile (required)
        :type appid: str
        :param model: the device model 'Nexus4' or 'iPad1,1' etc. (required)
        :type model: str
        :param name: the device name, 'occam' or 'iPhone' etc. (required)
        :type name: str
        :param platform: the device platform 'iOS' or 'Android' etc. (required)
        :type platform: str
        :param pushid: the device PUSH token/key/identifier/registration id (required)
        :type pushid: str
        :param uuid: the device UUID (required)
        :type uuid: str
        :param version: the device version '6.1.2' or '4.2.2' etc. (required)
        :type version: str
        :param publickey: the app generated public key
        :type publickey: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_add_user_device_serialize(
            appid=appid,
            model=model,
            name=name,
            platform=platform,
            pushid=pushid,
            uuid=uuid,
            version=version,
            publickey=publickey,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[List[AuthEmailGetSignupSettingsResponseWarningsInner]]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_add_user_device(
        self,
        appid: Annotated[Optional[StrictStr], Field(description="the app id, usually something like com.moodle.moodlemobile")],
        model: Annotated[Optional[StrictStr], Field(description="the device model 'Nexus4' or 'iPad1,1' etc.")],
        name: Annotated[Optional[StrictStr], Field(description="the device name, 'occam' or 'iPhone' etc.")],
        platform: Annotated[Optional[StrictStr], Field(description="the device platform 'iOS' or 'Android' etc.")],
        pushid: Annotated[Optional[StrictStr], Field(description="the device PUSH token/key/identifier/registration id")],
        uuid: Annotated[Optional[StrictStr], Field(description="the device UUID")],
        version: Annotated[Optional[StrictStr], Field(description="the device version '6.1.2' or '4.2.2' etc.")],
        publickey: Annotated[Optional[StrictStr], Field(description="the app generated public key")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Store mobile user devices information for PUSH Notifications.

        Store mobile user devices information for PUSH Notifications.

        :param appid: the app id, usually something like com.moodle.moodlemobile (required)
        :type appid: str
        :param model: the device model 'Nexus4' or 'iPad1,1' etc. (required)
        :type model: str
        :param name: the device name, 'occam' or 'iPhone' etc. (required)
        :type name: str
        :param platform: the device platform 'iOS' or 'Android' etc. (required)
        :type platform: str
        :param pushid: the device PUSH token/key/identifier/registration id (required)
        :type pushid: str
        :param uuid: the device UUID (required)
        :type uuid: str
        :param version: the device version '6.1.2' or '4.2.2' etc. (required)
        :type version: str
        :param publickey: the app generated public key
        :type publickey: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_add_user_device_serialize(
            appid=appid,
            model=model,
            name=name,
            platform=platform,
            pushid=pushid,
            uuid=uuid,
            version=version,
            publickey=publickey,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[List[AuthEmailGetSignupSettingsResponseWarningsInner]]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_add_user_device_from_args(
        self,
        args
    ) -> List[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[List[AuthEmailGetSignupSettingsResponseWarningsInner]]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_add_user_device_with_http_info(
        self,
        appid: Annotated[Optional[StrictStr], Field(description="the app id, usually something like com.moodle.moodlemobile")],
        model: Annotated[Optional[StrictStr], Field(description="the device model 'Nexus4' or 'iPad1,1' etc.")],
        name: Annotated[Optional[StrictStr], Field(description="the device name, 'occam' or 'iPhone' etc.")],
        platform: Annotated[Optional[StrictStr], Field(description="the device platform 'iOS' or 'Android' etc.")],
        pushid: Annotated[Optional[StrictStr], Field(description="the device PUSH token/key/identifier/registration id")],
        uuid: Annotated[Optional[StrictStr], Field(description="the device UUID")],
        version: Annotated[Optional[StrictStr], Field(description="the device version '6.1.2' or '4.2.2' etc.")],
        publickey: Annotated[Optional[StrictStr], Field(description="the app generated public key")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[List[AuthEmailGetSignupSettingsResponseWarningsInner]]]:
        """Store mobile user devices information for PUSH Notifications.

        Store mobile user devices information for PUSH Notifications.

        :param appid: the app id, usually something like com.moodle.moodlemobile (required)
        :type appid: str
        :param model: the device model 'Nexus4' or 'iPad1,1' etc. (required)
        :type model: str
        :param name: the device name, 'occam' or 'iPhone' etc. (required)
        :type name: str
        :param platform: the device platform 'iOS' or 'Android' etc. (required)
        :type platform: str
        :param pushid: the device PUSH token/key/identifier/registration id (required)
        :type pushid: str
        :param uuid: the device UUID (required)
        :type uuid: str
        :param version: the device version '6.1.2' or '4.2.2' etc. (required)
        :type version: str
        :param publickey: the app generated public key
        :type publickey: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_add_user_device_serialize(
            appid=appid,
            model=model,
            name=name,
            platform=platform,
            pushid=pushid,
            uuid=uuid,
            version=version,
            publickey=publickey,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[List[AuthEmailGetSignupSettingsResponseWarningsInner]]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_add_user_device_without_preload_content(
        self,
        appid: Annotated[Optional[StrictStr], Field(description="the app id, usually something like com.moodle.moodlemobile")],
        model: Annotated[Optional[StrictStr], Field(description="the device model 'Nexus4' or 'iPad1,1' etc.")],
        name: Annotated[Optional[StrictStr], Field(description="the device name, 'occam' or 'iPhone' etc.")],
        platform: Annotated[Optional[StrictStr], Field(description="the device platform 'iOS' or 'Android' etc.")],
        pushid: Annotated[Optional[StrictStr], Field(description="the device PUSH token/key/identifier/registration id")],
        uuid: Annotated[Optional[StrictStr], Field(description="the device UUID")],
        version: Annotated[Optional[StrictStr], Field(description="the device version '6.1.2' or '4.2.2' etc.")],
        publickey: Annotated[Optional[StrictStr], Field(description="the app generated public key")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Store mobile user devices information for PUSH Notifications.

        Store mobile user devices information for PUSH Notifications.

        :param appid: the app id, usually something like com.moodle.moodlemobile (required)
        :type appid: str
        :param model: the device model 'Nexus4' or 'iPad1,1' etc. (required)
        :type model: str
        :param name: the device name, 'occam' or 'iPhone' etc. (required)
        :type name: str
        :param platform: the device platform 'iOS' or 'Android' etc. (required)
        :type platform: str
        :param pushid: the device PUSH token/key/identifier/registration id (required)
        :type pushid: str
        :param uuid: the device UUID (required)
        :type uuid: str
        :param version: the device version '6.1.2' or '4.2.2' etc. (required)
        :type version: str
        :param publickey: the app generated public key
        :type publickey: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_add_user_device_serialize(
            appid=appid,
            model=model,
            name=name,
            platform=platform,
            pushid=pushid,
            uuid=uuid,
            version=version,
            publickey=publickey,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[List[AuthEmailGetSignupSettingsResponseWarningsInner]]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_add_user_device_serialize(
        self,
        appid,
        model,
        name,
        platform,
        pushid,
        uuid,
        version,
        publickey,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_user_add_user_device'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_add_user_device'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_add_user_device',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if appid is not None:
            _form_params += parse_form({'appid': appid})
        if model is not None:
            _form_params += parse_form({'model': model})
        if name is not None:
            _form_params += parse_form({'name': name})
        if platform is not None:
            _form_params += parse_form({'platform': platform})
        if publickey is not None:
            _form_params += parse_form({'publickey': publickey})
        if pushid is not None:
            _form_params += parse_form({'pushid': pushid})
        if uuid is not None:
            _form_params += parse_form({'uuid': uuid})
        if version is not None:
            _form_params += parse_form({'version': version})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_add_user_private_files_args(
        self,
        draftid: Annotated[Optional[StrictInt], Field(description="draft area id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Copy files from a draft area to users private files area.

        Copy files from a draft area to users private files area.

        :param draftid: draft area id (required)
        :type draftid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_add_user_private_files_serialize(
            draftid=draftid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_add_user_private_files(
        self,
        draftid: Annotated[Optional[StrictInt], Field(description="draft area id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Copy files from a draft area to users private files area.

        Copy files from a draft area to users private files area.

        :param draftid: draft area id (required)
        :type draftid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_add_user_private_files_serialize(
            draftid=draftid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_add_user_private_files_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_add_user_private_files_with_http_info(
        self,
        draftid: Annotated[Optional[StrictInt], Field(description="draft area id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Copy files from a draft area to users private files area.

        Copy files from a draft area to users private files area.

        :param draftid: draft area id (required)
        :type draftid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_add_user_private_files_serialize(
            draftid=draftid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_add_user_private_files_without_preload_content(
        self,
        draftid: Annotated[Optional[StrictInt], Field(description="draft area id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Copy files from a draft area to users private files area.

        Copy files from a draft area to users private files area.

        :param draftid: draft area id (required)
        :type draftid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_add_user_private_files_serialize(
            draftid=draftid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_add_user_private_files_serialize(
        self,
        draftid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_user_add_user_private_files'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_add_user_private_files'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_add_user_private_files',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if draftid is not None:
            _form_params += parse_form({'draftid': draftid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_agree_site_policy_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Agree the site policy for the current user.

        Agree the site policy for the current user.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_agree_site_policy_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserAgreeSitePolicyResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_agree_site_policy(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreUserAgreeSitePolicyResponse:
        """Agree the site policy for the current user.

        Agree the site policy for the current user.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_agree_site_policy_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserAgreeSitePolicyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_agree_site_policy_from_args(
        self,
        args
    ) -> CoreUserAgreeSitePolicyResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserAgreeSitePolicyResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_agree_site_policy_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreUserAgreeSitePolicyResponse]:
        """Agree the site policy for the current user.

        Agree the site policy for the current user.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_agree_site_policy_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserAgreeSitePolicyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_agree_site_policy_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Agree the site policy for the current user.

        Agree the site policy for the current user.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_agree_site_policy_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserAgreeSitePolicyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_agree_site_policy_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_user_agree_site_policy'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_agree_site_policy'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_agree_site_policy',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_create_users_args(
        self,
        users: List[CoreUserCreateUsersParametersUsersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Create users.

        Create users.

        :param users: (required)
        :type users: List[CoreUserCreateUsersParametersUsersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_create_users_serialize(
            users=users,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreUserCreateUsersResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_create_users(
        self,
        users: List[CoreUserCreateUsersParametersUsersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreUserCreateUsersResponseInner]:
        """Create users.

        Create users.

        :param users: (required)
        :type users: List[CoreUserCreateUsersParametersUsersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_create_users_serialize(
            users=users,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreUserCreateUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_create_users_from_args(
        self,
        args
    ) -> List[CoreUserCreateUsersResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreUserCreateUsersResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_create_users_with_http_info(
        self,
        users: List[CoreUserCreateUsersParametersUsersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreUserCreateUsersResponseInner]]:
        """Create users.

        Create users.

        :param users: (required)
        :type users: List[CoreUserCreateUsersParametersUsersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_create_users_serialize(
            users=users,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreUserCreateUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_create_users_without_preload_content(
        self,
        users: List[CoreUserCreateUsersParametersUsersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create users.

        Create users.

        :param users: (required)
        :type users: List[CoreUserCreateUsersParametersUsersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_create_users_serialize(
            users=users,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreUserCreateUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_create_users_serialize(
        self,
        users,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'users': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_user_create_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_create_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_create_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if users is not None:
            _form_params += parse_form({'users': users})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_delete_users_args(
        self,
        userids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete users.

        Delete users.

        :param userids: (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_delete_users_serialize(
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_delete_users(
        self,
        userids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Delete users.

        Delete users.

        :param userids: (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_delete_users_serialize(
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_delete_users_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_delete_users_with_http_info(
        self,
        userids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Delete users.

        Delete users.

        :param userids: (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_delete_users_serialize(
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_delete_users_without_preload_content(
        self,
        userids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete users.

        Delete users.

        :param userids: (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_delete_users_serialize(
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_delete_users_serialize(
        self,
        userids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'userids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_user_delete_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_delete_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_delete_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userids is not None:
            _form_params += parse_form({'userids': userids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_get_course_user_profiles_args(
        self,
        userlist: List[CoreUserGetCourseUserProfilesParametersUserlistInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get course user profiles (each of the profils matching a course id and a user id),.

        Get course user profiles (each of the profils matching a course id and a user id),.

        :param userlist: (required)
        :type userlist: List[CoreUserGetCourseUserProfilesParametersUserlistInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_course_user_profiles_serialize(
            userlist=userlist,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreUserGetCourseUserProfilesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_get_course_user_profiles(
        self,
        userlist: List[CoreUserGetCourseUserProfilesParametersUserlistInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreUserGetCourseUserProfilesResponseInner]:
        """Get course user profiles (each of the profils matching a course id and a user id),.

        Get course user profiles (each of the profils matching a course id and a user id),.

        :param userlist: (required)
        :type userlist: List[CoreUserGetCourseUserProfilesParametersUserlistInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_course_user_profiles_serialize(
            userlist=userlist,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreUserGetCourseUserProfilesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_get_course_user_profiles_from_args(
        self,
        args
    ) -> List[CoreUserGetCourseUserProfilesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreUserGetCourseUserProfilesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_get_course_user_profiles_with_http_info(
        self,
        userlist: List[CoreUserGetCourseUserProfilesParametersUserlistInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreUserGetCourseUserProfilesResponseInner]]:
        """Get course user profiles (each of the profils matching a course id and a user id),.

        Get course user profiles (each of the profils matching a course id and a user id),.

        :param userlist: (required)
        :type userlist: List[CoreUserGetCourseUserProfilesParametersUserlistInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_course_user_profiles_serialize(
            userlist=userlist,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreUserGetCourseUserProfilesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_get_course_user_profiles_without_preload_content(
        self,
        userlist: List[CoreUserGetCourseUserProfilesParametersUserlistInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get course user profiles (each of the profils matching a course id and a user id),.

        Get course user profiles (each of the profils matching a course id and a user id),.

        :param userlist: (required)
        :type userlist: List[CoreUserGetCourseUserProfilesParametersUserlistInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_course_user_profiles_serialize(
            userlist=userlist,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreUserGetCourseUserProfilesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_get_course_user_profiles_serialize(
        self,
        userlist,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'userlist': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_user_get_course_user_profiles'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_get_course_user_profiles'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_get_course_user_profiles',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userlist is not None:
            _form_params += parse_form({'userlist': userlist})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_get_private_files_info_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="Id of the user, default to current user.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns general information about files in the user private files area.

        Returns general information about files in the user private files area.

        :param userid: Id of the user, default to current user.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_private_files_info_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserGetPrivateFilesInfoResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_get_private_files_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="Id of the user, default to current user.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreUserGetPrivateFilesInfoResponse:
        """Returns general information about files in the user private files area.

        Returns general information about files in the user private files area.

        :param userid: Id of the user, default to current user.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_private_files_info_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserGetPrivateFilesInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_get_private_files_info_from_args(
        self,
        args
    ) -> CoreUserGetPrivateFilesInfoResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserGetPrivateFilesInfoResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_get_private_files_info_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="Id of the user, default to current user.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreUserGetPrivateFilesInfoResponse]:
        """Returns general information about files in the user private files area.

        Returns general information about files in the user private files area.

        :param userid: Id of the user, default to current user.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_private_files_info_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserGetPrivateFilesInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_get_private_files_info_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="Id of the user, default to current user.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns general information about files in the user private files area.

        Returns general information about files in the user private files area.

        :param userid: Id of the user, default to current user.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_private_files_info_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserGetPrivateFilesInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_get_private_files_info_serialize(
        self,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_user_get_private_files_info'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_get_private_files_info'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_get_private_files_info',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_get_user_preferences_args(
        self,
        name: Annotated[Optional[StrictStr], Field(description="preference name, empty for all")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, default to current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return user preferences.

        Return user preferences.

        :param name: preference name, empty for all
        :type name: str
        :param userid: id of the user, default to current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_user_preferences_serialize(
            name=name,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserGetUserPreferencesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_get_user_preferences(
        self,
        name: Annotated[Optional[StrictStr], Field(description="preference name, empty for all")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, default to current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreUserGetUserPreferencesResponse:
        """Return user preferences.

        Return user preferences.

        :param name: preference name, empty for all
        :type name: str
        :param userid: id of the user, default to current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_user_preferences_serialize(
            name=name,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserGetUserPreferencesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_get_user_preferences_from_args(
        self,
        args
    ) -> CoreUserGetUserPreferencesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserGetUserPreferencesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_get_user_preferences_with_http_info(
        self,
        name: Annotated[Optional[StrictStr], Field(description="preference name, empty for all")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, default to current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreUserGetUserPreferencesResponse]:
        """Return user preferences.

        Return user preferences.

        :param name: preference name, empty for all
        :type name: str
        :param userid: id of the user, default to current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_user_preferences_serialize(
            name=name,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserGetUserPreferencesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_get_user_preferences_without_preload_content(
        self,
        name: Annotated[Optional[StrictStr], Field(description="preference name, empty for all")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, default to current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return user preferences.

        Return user preferences.

        :param name: preference name, empty for all
        :type name: str
        :param userid: id of the user, default to current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_user_preferences_serialize(
            name=name,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserGetUserPreferencesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_get_user_preferences_serialize(
        self,
        name,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_user_get_user_preferences'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_get_user_preferences'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_get_user_preferences',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if name is not None:
            _form_params += parse_form({'name': name})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_get_users_args(
        self,
        criteria: Annotated[List[CoreUserGetUsersParametersCriteriaInner], Field(description="the key/value pairs to be considered in user search. Values can not be empty.                         Specify different keys only once (fullname => 'user1', auth => 'manual', ...) -                         key occurences are forbidden.                         The search is executed with AND operator on the criterias. Invalid criterias (keys) are ignored,                         the search is still executed on the valid criterias.                         You can search without criteria, but the function is not designed for it.                         It could very slow or timeout. The function is designed to search some specific users.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """search for users matching the parameters

        search for users matching the parameters

        :param criteria: the key/value pairs to be considered in user search. Values can not be empty.                         Specify different keys only once (fullname => 'user1', auth => 'manual', ...) -                         key occurences are forbidden.                         The search is executed with AND operator on the criterias. Invalid criterias (keys) are ignored,                         the search is still executed on the valid criterias.                         You can search without criteria, but the function is not designed for it.                         It could very slow or timeout. The function is designed to search some specific users. (required)
        :type criteria: List[CoreUserGetUsersParametersCriteriaInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_users_serialize(
            criteria=criteria,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserGetUsersResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_get_users(
        self,
        criteria: Annotated[List[CoreUserGetUsersParametersCriteriaInner], Field(description="the key/value pairs to be considered in user search. Values can not be empty.                         Specify different keys only once (fullname => 'user1', auth => 'manual', ...) -                         key occurences are forbidden.                         The search is executed with AND operator on the criterias. Invalid criterias (keys) are ignored,                         the search is still executed on the valid criterias.                         You can search without criteria, but the function is not designed for it.                         It could very slow or timeout. The function is designed to search some specific users.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreUserGetUsersResponse:
        """search for users matching the parameters

        search for users matching the parameters

        :param criteria: the key/value pairs to be considered in user search. Values can not be empty.                         Specify different keys only once (fullname => 'user1', auth => 'manual', ...) -                         key occurences are forbidden.                         The search is executed with AND operator on the criterias. Invalid criterias (keys) are ignored,                         the search is still executed on the valid criterias.                         You can search without criteria, but the function is not designed for it.                         It could very slow or timeout. The function is designed to search some specific users. (required)
        :type criteria: List[CoreUserGetUsersParametersCriteriaInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_users_serialize(
            criteria=criteria,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserGetUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_get_users_from_args(
        self,
        args
    ) -> CoreUserGetUsersResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserGetUsersResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_get_users_with_http_info(
        self,
        criteria: Annotated[List[CoreUserGetUsersParametersCriteriaInner], Field(description="the key/value pairs to be considered in user search. Values can not be empty.                         Specify different keys only once (fullname => 'user1', auth => 'manual', ...) -                         key occurences are forbidden.                         The search is executed with AND operator on the criterias. Invalid criterias (keys) are ignored,                         the search is still executed on the valid criterias.                         You can search without criteria, but the function is not designed for it.                         It could very slow or timeout. The function is designed to search some specific users.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreUserGetUsersResponse]:
        """search for users matching the parameters

        search for users matching the parameters

        :param criteria: the key/value pairs to be considered in user search. Values can not be empty.                         Specify different keys only once (fullname => 'user1', auth => 'manual', ...) -                         key occurences are forbidden.                         The search is executed with AND operator on the criterias. Invalid criterias (keys) are ignored,                         the search is still executed on the valid criterias.                         You can search without criteria, but the function is not designed for it.                         It could very slow or timeout. The function is designed to search some specific users. (required)
        :type criteria: List[CoreUserGetUsersParametersCriteriaInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_users_serialize(
            criteria=criteria,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserGetUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_get_users_without_preload_content(
        self,
        criteria: Annotated[List[CoreUserGetUsersParametersCriteriaInner], Field(description="the key/value pairs to be considered in user search. Values can not be empty.                         Specify different keys only once (fullname => 'user1', auth => 'manual', ...) -                         key occurences are forbidden.                         The search is executed with AND operator on the criterias. Invalid criterias (keys) are ignored,                         the search is still executed on the valid criterias.                         You can search without criteria, but the function is not designed for it.                         It could very slow or timeout. The function is designed to search some specific users.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """search for users matching the parameters

        search for users matching the parameters

        :param criteria: the key/value pairs to be considered in user search. Values can not be empty.                         Specify different keys only once (fullname => 'user1', auth => 'manual', ...) -                         key occurences are forbidden.                         The search is executed with AND operator on the criterias. Invalid criterias (keys) are ignored,                         the search is still executed on the valid criterias.                         You can search without criteria, but the function is not designed for it.                         It could very slow or timeout. The function is designed to search some specific users. (required)
        :type criteria: List[CoreUserGetUsersParametersCriteriaInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_users_serialize(
            criteria=criteria,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserGetUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_get_users_serialize(
        self,
        criteria,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'criteria': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_user_get_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_get_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_get_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if criteria is not None:
            _form_params += parse_form({'criteria': criteria})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_get_users_by_field_args(
        self,
        var_field: Annotated[Optional[StrictStr], Field(description="the search field can be                     'id' or 'idnumber' or 'username' or 'email'")],
        values: List[Optional[StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve users' information for a specified unique field - If you want to do a user search, use core_user_get_users() or core_user_search_identity().

        Retrieve users' information for a specified unique field - If you want to do a user search, use core_user_get_users() or core_user_search_identity().

        :param var_field: the search field can be                     'id' or 'idnumber' or 'username' or 'email' (required)
        :type var_field: str
        :param values: (required)
        :type values: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_users_by_field_serialize(
            var_field=var_field,
            values=values,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetPotentialUsersResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_get_users_by_field(
        self,
        var_field: Annotated[Optional[StrictStr], Field(description="the search field can be                     'id' or 'idnumber' or 'username' or 'email'")],
        values: List[Optional[StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreEnrolGetPotentialUsersResponseInner]:
        """Retrieve users' information for a specified unique field - If you want to do a user search, use core_user_get_users() or core_user_search_identity().

        Retrieve users' information for a specified unique field - If you want to do a user search, use core_user_get_users() or core_user_search_identity().

        :param var_field: the search field can be                     'id' or 'idnumber' or 'username' or 'email' (required)
        :type var_field: str
        :param values: (required)
        :type values: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_users_by_field_serialize(
            var_field=var_field,
            values=values,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetPotentialUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_get_users_by_field_from_args(
        self,
        args
    ) -> List[CoreEnrolGetPotentialUsersResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetPotentialUsersResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_get_users_by_field_with_http_info(
        self,
        var_field: Annotated[Optional[StrictStr], Field(description="the search field can be                     'id' or 'idnumber' or 'username' or 'email'")],
        values: List[Optional[StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreEnrolGetPotentialUsersResponseInner]]:
        """Retrieve users' information for a specified unique field - If you want to do a user search, use core_user_get_users() or core_user_search_identity().

        Retrieve users' information for a specified unique field - If you want to do a user search, use core_user_get_users() or core_user_search_identity().

        :param var_field: the search field can be                     'id' or 'idnumber' or 'username' or 'email' (required)
        :type var_field: str
        :param values: (required)
        :type values: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_users_by_field_serialize(
            var_field=var_field,
            values=values,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetPotentialUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_get_users_by_field_without_preload_content(
        self,
        var_field: Annotated[Optional[StrictStr], Field(description="the search field can be                     'id' or 'idnumber' or 'username' or 'email'")],
        values: List[Optional[StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve users' information for a specified unique field - If you want to do a user search, use core_user_get_users() or core_user_search_identity().

        Retrieve users' information for a specified unique field - If you want to do a user search, use core_user_get_users() or core_user_search_identity().

        :param var_field: the search field can be                     'id' or 'idnumber' or 'username' or 'email' (required)
        :type var_field: str
        :param values: (required)
        :type values: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_get_users_by_field_serialize(
            var_field=var_field,
            values=values,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreEnrolGetPotentialUsersResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_get_users_by_field_serialize(
        self,
        var_field,
        values,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'values': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_user_get_users_by_field'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_get_users_by_field'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_get_users_by_field',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if var_field is not None:
            _form_params += parse_form({'field': var_field})
        if values is not None:
            _form_params += parse_form({'values': values})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_prepare_private_files_for_edition_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Prepares the draft area for user private files.

        Prepares the draft area for user private files.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_prepare_private_files_for_edition_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserPreparePrivateFilesForEditionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_prepare_private_files_for_edition(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreUserPreparePrivateFilesForEditionResponse:
        """Prepares the draft area for user private files.

        Prepares the draft area for user private files.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_prepare_private_files_for_edition_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserPreparePrivateFilesForEditionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_prepare_private_files_for_edition_from_args(
        self,
        args
    ) -> CoreUserPreparePrivateFilesForEditionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserPreparePrivateFilesForEditionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_prepare_private_files_for_edition_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreUserPreparePrivateFilesForEditionResponse]:
        """Prepares the draft area for user private files.

        Prepares the draft area for user private files.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_prepare_private_files_for_edition_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserPreparePrivateFilesForEditionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_prepare_private_files_for_edition_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Prepares the draft area for user private files.

        Prepares the draft area for user private files.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_prepare_private_files_for_edition_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserPreparePrivateFilesForEditionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_prepare_private_files_for_edition_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_user_prepare_private_files_for_edition'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_prepare_private_files_for_edition'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_prepare_private_files_for_edition',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_remove_user_device_args(
        self,
        uuid: Annotated[Optional[StrictStr], Field(description="the device UUID")],
        appid: Annotated[Optional[StrictStr], Field(description="the app id, if empty devices matching the UUID for the user will be removed")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Remove a user device from the Moodle database.

        Remove a user device from the Moodle database.

        :param uuid: the device UUID (required)
        :type uuid: str
        :param appid: the app id, if empty devices matching the UUID for the user will be removed
        :type appid: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_remove_user_device_serialize(
            uuid=uuid,
            appid=appid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserRemoveUserDeviceResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_remove_user_device(
        self,
        uuid: Annotated[Optional[StrictStr], Field(description="the device UUID")],
        appid: Annotated[Optional[StrictStr], Field(description="the app id, if empty devices matching the UUID for the user will be removed")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreUserRemoveUserDeviceResponse:
        """Remove a user device from the Moodle database.

        Remove a user device from the Moodle database.

        :param uuid: the device UUID (required)
        :type uuid: str
        :param appid: the app id, if empty devices matching the UUID for the user will be removed
        :type appid: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_remove_user_device_serialize(
            uuid=uuid,
            appid=appid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserRemoveUserDeviceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_remove_user_device_from_args(
        self,
        args
    ) -> CoreUserRemoveUserDeviceResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserRemoveUserDeviceResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_remove_user_device_with_http_info(
        self,
        uuid: Annotated[Optional[StrictStr], Field(description="the device UUID")],
        appid: Annotated[Optional[StrictStr], Field(description="the app id, if empty devices matching the UUID for the user will be removed")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreUserRemoveUserDeviceResponse]:
        """Remove a user device from the Moodle database.

        Remove a user device from the Moodle database.

        :param uuid: the device UUID (required)
        :type uuid: str
        :param appid: the app id, if empty devices matching the UUID for the user will be removed
        :type appid: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_remove_user_device_serialize(
            uuid=uuid,
            appid=appid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserRemoveUserDeviceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_remove_user_device_without_preload_content(
        self,
        uuid: Annotated[Optional[StrictStr], Field(description="the device UUID")],
        appid: Annotated[Optional[StrictStr], Field(description="the app id, if empty devices matching the UUID for the user will be removed")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Remove a user device from the Moodle database.

        Remove a user device from the Moodle database.

        :param uuid: the device UUID (required)
        :type uuid: str
        :param appid: the app id, if empty devices matching the UUID for the user will be removed
        :type appid: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_remove_user_device_serialize(
            uuid=uuid,
            appid=appid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserRemoveUserDeviceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_remove_user_device_serialize(
        self,
        uuid,
        appid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_user_remove_user_device'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_remove_user_device'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_remove_user_device',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if appid is not None:
            _form_params += parse_form({'appid': appid})
        if uuid is not None:
            _form_params += parse_form({'uuid': uuid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_search_identity_args(
        self,
        query: Annotated[Optional[StrictStr], Field(description="The search query")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return list of users identities matching the given criteria in their name or other identity fields.

        Return list of users identities matching the given criteria in their name or other identity fields.

        :param query: The search query (required)
        :type query: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_search_identity_serialize(
            query=query,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserSearchIdentityResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_search_identity(
        self,
        query: Annotated[Optional[StrictStr], Field(description="The search query")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreUserSearchIdentityResponse:
        """Return list of users identities matching the given criteria in their name or other identity fields.

        Return list of users identities matching the given criteria in their name or other identity fields.

        :param query: The search query (required)
        :type query: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_search_identity_serialize(
            query=query,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserSearchIdentityResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_search_identity_from_args(
        self,
        args
    ) -> CoreUserSearchIdentityResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserSearchIdentityResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_search_identity_with_http_info(
        self,
        query: Annotated[Optional[StrictStr], Field(description="The search query")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreUserSearchIdentityResponse]:
        """Return list of users identities matching the given criteria in their name or other identity fields.

        Return list of users identities matching the given criteria in their name or other identity fields.

        :param query: The search query (required)
        :type query: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_search_identity_serialize(
            query=query,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserSearchIdentityResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_search_identity_without_preload_content(
        self,
        query: Annotated[Optional[StrictStr], Field(description="The search query")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return list of users identities matching the given criteria in their name or other identity fields.

        Return list of users identities matching the given criteria in their name or other identity fields.

        :param query: The search query (required)
        :type query: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_search_identity_serialize(
            query=query,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserSearchIdentityResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_search_identity_serialize(
        self,
        query,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_user_search_identity'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_search_identity'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_search_identity',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if query is not None:
            _form_params += parse_form({'query': query})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_set_user_preferences_args(
        self,
        args: CoreUserSetUserPreferencesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set user preferences.

        Set user preferences.

        :param args: (required)
        :type args: CoreUserSetUserPreferencesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_set_user_preferences_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserSetUserPreferencesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_set_user_preferences(
        self,
        args: CoreUserSetUserPreferencesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreUserSetUserPreferencesResponse:
        """Set user preferences.

        Set user preferences.

        :param args: (required)
        :type args: CoreUserSetUserPreferencesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_set_user_preferences_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserSetUserPreferencesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_set_user_preferences_from_args(
        self,
        args
    ) -> CoreUserSetUserPreferencesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserSetUserPreferencesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_set_user_preferences_with_http_info(
        self,
        args: CoreUserSetUserPreferencesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreUserSetUserPreferencesResponse]:
        """Set user preferences.

        Set user preferences.

        :param args: (required)
        :type args: CoreUserSetUserPreferencesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_set_user_preferences_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserSetUserPreferencesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_set_user_preferences_without_preload_content(
        self,
        args: CoreUserSetUserPreferencesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set user preferences.

        Set user preferences.

        :param args: (required)
        :type args: CoreUserSetUserPreferencesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_set_user_preferences_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserSetUserPreferencesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_set_user_preferences_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#core_user_set_user_preferences'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_set_user_preferences'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_set_user_preferences',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_update_picture_args(
        self,
        draftitemid: Annotated[Optional[StrictInt], Field(description="Id of the user draft file to use as image")],
        delete: Annotated[Optional[StrictBool], Field(description="If we should delete the user picture")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update or delete the user picture in the site

        Update or delete the user picture in the site

        :param draftitemid: Id of the user draft file to use as image (required)
        :type draftitemid: int
        :param delete: If we should delete the user picture
        :type delete: bool
        :param userid: Id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_picture_serialize(
            draftitemid=draftitemid,
            delete=delete,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdatePictureResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_update_picture(
        self,
        draftitemid: Annotated[Optional[StrictInt], Field(description="Id of the user draft file to use as image")],
        delete: Annotated[Optional[StrictBool], Field(description="If we should delete the user picture")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreUserUpdatePictureResponse:
        """Update or delete the user picture in the site

        Update or delete the user picture in the site

        :param draftitemid: Id of the user draft file to use as image (required)
        :type draftitemid: int
        :param delete: If we should delete the user picture
        :type delete: bool
        :param userid: Id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_picture_serialize(
            draftitemid=draftitemid,
            delete=delete,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdatePictureResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_update_picture_from_args(
        self,
        args
    ) -> CoreUserUpdatePictureResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdatePictureResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_update_picture_with_http_info(
        self,
        draftitemid: Annotated[Optional[StrictInt], Field(description="Id of the user draft file to use as image")],
        delete: Annotated[Optional[StrictBool], Field(description="If we should delete the user picture")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreUserUpdatePictureResponse]:
        """Update or delete the user picture in the site

        Update or delete the user picture in the site

        :param draftitemid: Id of the user draft file to use as image (required)
        :type draftitemid: int
        :param delete: If we should delete the user picture
        :type delete: bool
        :param userid: Id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_picture_serialize(
            draftitemid=draftitemid,
            delete=delete,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdatePictureResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_update_picture_without_preload_content(
        self,
        draftitemid: Annotated[Optional[StrictInt], Field(description="Id of the user draft file to use as image")],
        delete: Annotated[Optional[StrictBool], Field(description="If we should delete the user picture")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Id of the user, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update or delete the user picture in the site

        Update or delete the user picture in the site

        :param draftitemid: Id of the user draft file to use as image (required)
        :type draftitemid: int
        :param delete: If we should delete the user picture
        :type delete: bool
        :param userid: Id of the user, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_picture_serialize(
            draftitemid=draftitemid,
            delete=delete,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdatePictureResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_update_picture_serialize(
        self,
        draftitemid,
        delete,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_user_update_picture'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_update_picture'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_update_picture',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if delete is not None:
            _form_params += parse_form({'delete': delete})
        if draftitemid is not None:
            _form_params += parse_form({'draftitemid': draftitemid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_update_private_files_args(
        self,
        draftitemid: Annotated[Optional[StrictInt], Field(description="The draft item id with the files.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Copy files from a draft area to users private files area.

        Copy files from a draft area to users private files area.

        :param draftitemid: The draft item id with the files. (required)
        :type draftitemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_private_files_serialize(
            draftitemid=draftitemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdatePrivateFilesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_update_private_files(
        self,
        draftitemid: Annotated[Optional[StrictInt], Field(description="The draft item id with the files.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreUserUpdatePrivateFilesResponse:
        """Copy files from a draft area to users private files area.

        Copy files from a draft area to users private files area.

        :param draftitemid: The draft item id with the files. (required)
        :type draftitemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_private_files_serialize(
            draftitemid=draftitemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdatePrivateFilesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_update_private_files_from_args(
        self,
        args
    ) -> CoreUserUpdatePrivateFilesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdatePrivateFilesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_update_private_files_with_http_info(
        self,
        draftitemid: Annotated[Optional[StrictInt], Field(description="The draft item id with the files.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreUserUpdatePrivateFilesResponse]:
        """Copy files from a draft area to users private files area.

        Copy files from a draft area to users private files area.

        :param draftitemid: The draft item id with the files. (required)
        :type draftitemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_private_files_serialize(
            draftitemid=draftitemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdatePrivateFilesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_update_private_files_without_preload_content(
        self,
        draftitemid: Annotated[Optional[StrictInt], Field(description="The draft item id with the files.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Copy files from a draft area to users private files area.

        Copy files from a draft area to users private files area.

        :param draftitemid: The draft item id with the files. (required)
        :type draftitemid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_private_files_serialize(
            draftitemid=draftitemid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdatePrivateFilesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_update_private_files_serialize(
        self,
        draftitemid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_user_update_private_files'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_update_private_files'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_update_private_files',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if draftitemid is not None:
            _form_params += parse_form({'draftitemid': draftitemid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_update_user_device_public_key_args(
        self,
        appid: Annotated[Optional[StrictStr], Field(description="The app id, something like com.moodle.moodlemobile")],
        publickey: Annotated[Optional[StrictStr], Field(description="the app generated public key")],
        uuid: Annotated[Optional[StrictStr], Field(description="the device UUID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Store mobile user public key.

        Store mobile user public key.

        :param appid: The app id, something like com.moodle.moodlemobile (required)
        :type appid: str
        :param publickey: the app generated public key (required)
        :type publickey: str
        :param uuid: the device UUID (required)
        :type uuid: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_user_device_public_key_serialize(
            appid=appid,
            publickey=publickey,
            uuid=uuid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdateUserDevicePublicKeyResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_update_user_device_public_key(
        self,
        appid: Annotated[Optional[StrictStr], Field(description="The app id, something like com.moodle.moodlemobile")],
        publickey: Annotated[Optional[StrictStr], Field(description="the app generated public key")],
        uuid: Annotated[Optional[StrictStr], Field(description="the device UUID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreUserUpdateUserDevicePublicKeyResponse:
        """Store mobile user public key.

        Store mobile user public key.

        :param appid: The app id, something like com.moodle.moodlemobile (required)
        :type appid: str
        :param publickey: the app generated public key (required)
        :type publickey: str
        :param uuid: the device UUID (required)
        :type uuid: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_user_device_public_key_serialize(
            appid=appid,
            publickey=publickey,
            uuid=uuid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdateUserDevicePublicKeyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_update_user_device_public_key_from_args(
        self,
        args
    ) -> CoreUserUpdateUserDevicePublicKeyResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdateUserDevicePublicKeyResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_update_user_device_public_key_with_http_info(
        self,
        appid: Annotated[Optional[StrictStr], Field(description="The app id, something like com.moodle.moodlemobile")],
        publickey: Annotated[Optional[StrictStr], Field(description="the app generated public key")],
        uuid: Annotated[Optional[StrictStr], Field(description="the device UUID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreUserUpdateUserDevicePublicKeyResponse]:
        """Store mobile user public key.

        Store mobile user public key.

        :param appid: The app id, something like com.moodle.moodlemobile (required)
        :type appid: str
        :param publickey: the app generated public key (required)
        :type publickey: str
        :param uuid: the device UUID (required)
        :type uuid: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_user_device_public_key_serialize(
            appid=appid,
            publickey=publickey,
            uuid=uuid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdateUserDevicePublicKeyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_update_user_device_public_key_without_preload_content(
        self,
        appid: Annotated[Optional[StrictStr], Field(description="The app id, something like com.moodle.moodlemobile")],
        publickey: Annotated[Optional[StrictStr], Field(description="the app generated public key")],
        uuid: Annotated[Optional[StrictStr], Field(description="the device UUID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Store mobile user public key.

        Store mobile user public key.

        :param appid: The app id, something like com.moodle.moodlemobile (required)
        :type appid: str
        :param publickey: the app generated public key (required)
        :type publickey: str
        :param uuid: the device UUID (required)
        :type uuid: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_user_device_public_key_serialize(
            appid=appid,
            publickey=publickey,
            uuid=uuid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdateUserDevicePublicKeyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_update_user_device_public_key_serialize(
        self,
        appid,
        publickey,
        uuid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_user_update_user_device_public_key'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_update_user_device_public_key'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_update_user_device_public_key',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if appid is not None:
            _form_params += parse_form({'appid': appid})
        if publickey is not None:
            _form_params += parse_form({'publickey': publickey})
        if uuid is not None:
            _form_params += parse_form({'uuid': uuid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_update_user_preferences_args(
        self,
        emailstop: Annotated[Optional[StrictInt], Field(description="Enable or disable notifications for this user")] = None,
        preferences: Annotated[Optional[List[CoreUserUpdateUserPreferencesParametersPreferencesInner]], Field(description="User preferences")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, default to current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update a user's preferences

        Update a user's preferences

        :param emailstop: Enable or disable notifications for this user
        :type emailstop: int
        :param preferences: User preferences
        :type preferences: List[CoreUserUpdateUserPreferencesParametersPreferencesInner]
        :param userid: id of the user, default to current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_user_preferences_serialize(
            emailstop=emailstop,
            preferences=preferences,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_update_user_preferences(
        self,
        emailstop: Annotated[Optional[StrictInt], Field(description="Enable or disable notifications for this user")] = None,
        preferences: Annotated[Optional[List[CoreUserUpdateUserPreferencesParametersPreferencesInner]], Field(description="User preferences")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, default to current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Update a user's preferences

        Update a user's preferences

        :param emailstop: Enable or disable notifications for this user
        :type emailstop: int
        :param preferences: User preferences
        :type preferences: List[CoreUserUpdateUserPreferencesParametersPreferencesInner]
        :param userid: id of the user, default to current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_user_preferences_serialize(
            emailstop=emailstop,
            preferences=preferences,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_update_user_preferences_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_update_user_preferences_with_http_info(
        self,
        emailstop: Annotated[Optional[StrictInt], Field(description="Enable or disable notifications for this user")] = None,
        preferences: Annotated[Optional[List[CoreUserUpdateUserPreferencesParametersPreferencesInner]], Field(description="User preferences")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, default to current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Update a user's preferences

        Update a user's preferences

        :param emailstop: Enable or disable notifications for this user
        :type emailstop: int
        :param preferences: User preferences
        :type preferences: List[CoreUserUpdateUserPreferencesParametersPreferencesInner]
        :param userid: id of the user, default to current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_user_preferences_serialize(
            emailstop=emailstop,
            preferences=preferences,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_update_user_preferences_without_preload_content(
        self,
        emailstop: Annotated[Optional[StrictInt], Field(description="Enable or disable notifications for this user")] = None,
        preferences: Annotated[Optional[List[CoreUserUpdateUserPreferencesParametersPreferencesInner]], Field(description="User preferences")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, default to current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update a user's preferences

        Update a user's preferences

        :param emailstop: Enable or disable notifications for this user
        :type emailstop: int
        :param preferences: User preferences
        :type preferences: List[CoreUserUpdateUserPreferencesParametersPreferencesInner]
        :param userid: id of the user, default to current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_user_preferences_serialize(
            emailstop=emailstop,
            preferences=preferences,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_update_user_preferences_serialize(
        self,
        emailstop,
        preferences,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'preferences': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_user_update_user_preferences'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_update_user_preferences'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_update_user_preferences',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if emailstop is not None:
            _form_params += parse_form({'emailstop': emailstop})
        if preferences is not None:
            _form_params += parse_form({'preferences': preferences})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_update_users_args(
        self,
        users: List[CoreUserUpdateUsersParametersUsersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update users.

        Update users.

        :param users: (required)
        :type users: List[CoreUserUpdateUsersParametersUsersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_users_serialize(
            users=users,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdateUsersResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_update_users(
        self,
        users: List[CoreUserUpdateUsersParametersUsersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreUserUpdateUsersResponse:
        """Update users.

        Update users.

        :param users: (required)
        :type users: List[CoreUserUpdateUsersParametersUsersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_users_serialize(
            users=users,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdateUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_update_users_from_args(
        self,
        args
    ) -> CoreUserUpdateUsersResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdateUsersResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_update_users_with_http_info(
        self,
        users: List[CoreUserUpdateUsersParametersUsersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreUserUpdateUsersResponse]:
        """Update users.

        Update users.

        :param users: (required)
        :type users: List[CoreUserUpdateUsersParametersUsersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_users_serialize(
            users=users,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdateUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_update_users_without_preload_content(
        self,
        users: List[CoreUserUpdateUsersParametersUsersInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update users.

        Update users.

        :param users: (required)
        :type users: List[CoreUserUpdateUsersParametersUsersInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_update_users_serialize(
            users=users,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserUpdateUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_update_users_serialize(
        self,
        users,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'users': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_user_update_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_update_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_update_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if users is not None:
            _form_params += parse_form({'users': users})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_view_user_list_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course, 0 for site")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Simulates the web-interface view of user/index.php (triggering events),.

        Simulates the web-interface view of user/index.php (triggering events),.

        :param courseid: id of the course, 0 for site (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_view_user_list_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserViewUserListResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_view_user_list(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course, 0 for site")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreUserViewUserListResponse:
        """Simulates the web-interface view of user/index.php (triggering events),.

        Simulates the web-interface view of user/index.php (triggering events),.

        :param courseid: id of the course, 0 for site (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_view_user_list_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserViewUserListResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_view_user_list_from_args(
        self,
        args
    ) -> CoreUserViewUserListResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserViewUserListResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_view_user_list_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course, 0 for site")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreUserViewUserListResponse]:
        """Simulates the web-interface view of user/index.php (triggering events),.

        Simulates the web-interface view of user/index.php (triggering events),.

        :param courseid: id of the course, 0 for site (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_view_user_list_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserViewUserListResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_view_user_list_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course, 0 for site")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Simulates the web-interface view of user/index.php (triggering events),.

        Simulates the web-interface view of user/index.php (triggering events),.

        :param courseid: id of the course, 0 for site (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_view_user_list_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserViewUserListResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_view_user_list_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_user_view_user_list'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_view_user_list'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_view_user_list',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_user_view_user_profile_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")],
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course, default site course")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Simulates the web-interface view of user/view.php and user/profile.php (triggering events),.

        Simulates the web-interface view of user/view.php and user/profile.php (triggering events),.

        :param userid: id of the user, 0 for current user (required)
        :type userid: int
        :param courseid: id of the course, default site course
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_view_user_profile_serialize(
            userid=userid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserViewUserProfileResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_user_view_user_profile(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")],
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course, default site course")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreUserViewUserProfileResponse:
        """Simulates the web-interface view of user/view.php and user/profile.php (triggering events),.

        Simulates the web-interface view of user/view.php and user/profile.php (triggering events),.

        :param userid: id of the user, 0 for current user (required)
        :type userid: int
        :param courseid: id of the course, default site course
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_view_user_profile_serialize(
            userid=userid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserViewUserProfileResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_view_user_profile_from_args(
        self,
        args
    ) -> CoreUserViewUserProfileResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserViewUserProfileResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_user_view_user_profile_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")],
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course, default site course")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreUserViewUserProfileResponse]:
        """Simulates the web-interface view of user/view.php and user/profile.php (triggering events),.

        Simulates the web-interface view of user/view.php and user/profile.php (triggering events),.

        :param userid: id of the user, 0 for current user (required)
        :type userid: int
        :param courseid: id of the course, default site course
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_view_user_profile_serialize(
            userid=userid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserViewUserProfileResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_user_view_user_profile_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 for current user")],
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course, default site course")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Simulates the web-interface view of user/view.php and user/profile.php (triggering events),.

        Simulates the web-interface view of user/view.php and user/profile.php (triggering events),.

        :param userid: id of the user, 0 for current user (required)
        :type userid: int
        :param courseid: id of the course, default site course
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_user_view_user_profile_serialize(
            userid=userid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreUserViewUserProfileResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_user_view_user_profile_serialize(
        self,
        userid,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_user_view_user_profile'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_user_view_user_profile'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_user_view_user_profile',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_webservice_get_site_info_args(
        self,
        serviceshortnames: Annotated[Optional[List[Optional[StrictStr]]], Field(description="DEPRECATED PARAMETER - it was a design error in the original implementation. \\\\                     It is ignored now. (parameter kept for backward compatibility)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return some site info / user info / list web service functions

        Return some site info / user info / list web service functions

        :param serviceshortnames: DEPRECATED PARAMETER - it was a design error in the original implementation. \\\\                     It is ignored now. (parameter kept for backward compatibility)
        :type serviceshortnames: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_webservice_get_site_info_serialize(
            serviceshortnames=serviceshortnames,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreWebserviceGetSiteInfoResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_webservice_get_site_info(
        self,
        serviceshortnames: Annotated[Optional[List[Optional[StrictStr]]], Field(description="DEPRECATED PARAMETER - it was a design error in the original implementation. \\\\                     It is ignored now. (parameter kept for backward compatibility)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CoreWebserviceGetSiteInfoResponse:
        """Return some site info / user info / list web service functions

        Return some site info / user info / list web service functions

        :param serviceshortnames: DEPRECATED PARAMETER - it was a design error in the original implementation. \\\\                     It is ignored now. (parameter kept for backward compatibility)
        :type serviceshortnames: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_webservice_get_site_info_serialize(
            serviceshortnames=serviceshortnames,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreWebserviceGetSiteInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_webservice_get_site_info_from_args(
        self,
        args
    ) -> CoreWebserviceGetSiteInfoResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreWebserviceGetSiteInfoResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_webservice_get_site_info_with_http_info(
        self,
        serviceshortnames: Annotated[Optional[List[Optional[StrictStr]]], Field(description="DEPRECATED PARAMETER - it was a design error in the original implementation. \\\\                     It is ignored now. (parameter kept for backward compatibility)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CoreWebserviceGetSiteInfoResponse]:
        """Return some site info / user info / list web service functions

        Return some site info / user info / list web service functions

        :param serviceshortnames: DEPRECATED PARAMETER - it was a design error in the original implementation. \\\\                     It is ignored now. (parameter kept for backward compatibility)
        :type serviceshortnames: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_webservice_get_site_info_serialize(
            serviceshortnames=serviceshortnames,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreWebserviceGetSiteInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_webservice_get_site_info_without_preload_content(
        self,
        serviceshortnames: Annotated[Optional[List[Optional[StrictStr]]], Field(description="DEPRECATED PARAMETER - it was a design error in the original implementation. \\\\                     It is ignored now. (parameter kept for backward compatibility)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return some site info / user info / list web service functions

        Return some site info / user info / list web service functions

        :param serviceshortnames: DEPRECATED PARAMETER - it was a design error in the original implementation. \\\\                     It is ignored now. (parameter kept for backward compatibility)
        :type serviceshortnames: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_webservice_get_site_info_serialize(
            serviceshortnames=serviceshortnames,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CoreWebserviceGetSiteInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_webservice_get_site_info_serialize(
        self,
        serviceshortnames,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'serviceshortnames': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#core_webservice_get_site_info'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_webservice_get_site_info'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_webservice_get_site_info',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if serviceshortnames is not None:
            _form_params += parse_form({'serviceshortnames': serviceshortnames})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_xapi_delete_state_args(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        state_id: Annotated[Optional[StrictStr], Field(description="The xAPI state ID")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete an xAPI state data from an activityId.

        Delete an xAPI state data from an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param state_id: The xAPI state ID (required)
        :type state_id: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_delete_state_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            state_id=state_id,
            registration=registration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_xapi_delete_state(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        state_id: Annotated[Optional[StrictStr], Field(description="The xAPI state ID")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Delete an xAPI state data from an activityId.

        Delete an xAPI state data from an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param state_id: The xAPI state ID (required)
        :type state_id: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_delete_state_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            state_id=state_id,
            registration=registration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_xapi_delete_state_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_xapi_delete_state_with_http_info(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        state_id: Annotated[Optional[StrictStr], Field(description="The xAPI state ID")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Delete an xAPI state data from an activityId.

        Delete an xAPI state data from an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param state_id: The xAPI state ID (required)
        :type state_id: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_delete_state_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            state_id=state_id,
            registration=registration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_xapi_delete_state_without_preload_content(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        state_id: Annotated[Optional[StrictStr], Field(description="The xAPI state ID")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete an xAPI state data from an activityId.

        Delete an xAPI state data from an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param state_id: The xAPI state ID (required)
        :type state_id: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_delete_state_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            state_id=state_id,
            registration=registration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_xapi_delete_state_serialize(
        self,
        activity_id,
        agent,
        component,
        state_id,
        registration,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_xapi_delete_state'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_xapi_delete_state'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_xapi_delete_state',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if activity_id is not None:
            _form_params += parse_form({'activityId': activity_id})
        if agent is not None:
            _form_params += parse_form({'agent': agent})
        if component is not None:
            _form_params += parse_form({'component': component})
        if registration is not None:
            _form_params += parse_form({'registration': registration})
        if state_id is not None:
            _form_params += parse_form({'stateId': state_id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_xapi_delete_states_args(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete all xAPI state data from an activityId.

        Delete all xAPI state data from an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_delete_states_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            registration=registration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_xapi_delete_states(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Delete all xAPI state data from an activityId.

        Delete all xAPI state data from an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_delete_states_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            registration=registration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_xapi_delete_states_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_xapi_delete_states_with_http_info(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Delete all xAPI state data from an activityId.

        Delete all xAPI state data from an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_delete_states_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            registration=registration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_xapi_delete_states_without_preload_content(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete all xAPI state data from an activityId.

        Delete all xAPI state data from an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_delete_states_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            registration=registration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_xapi_delete_states_serialize(
        self,
        activity_id,
        agent,
        component,
        registration,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_xapi_delete_states'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_xapi_delete_states'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_xapi_delete_states',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if activity_id is not None:
            _form_params += parse_form({'activityId': activity_id})
        if agent is not None:
            _form_params += parse_form({'agent': agent})
        if component is not None:
            _form_params += parse_form({'component': component})
        if registration is not None:
            _form_params += parse_form({'registration': registration})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_xapi_get_state_args(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        state_id: Annotated[Optional[StrictStr], Field(description="The xAPI state ID")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get an xAPI state data from an activityId.

        Get an xAPI state data from an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param state_id: The xAPI state ID (required)
        :type state_id: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_get_state_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            state_id=state_id,
            registration=registration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_xapi_get_state(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        state_id: Annotated[Optional[StrictStr], Field(description="The xAPI state ID")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """Get an xAPI state data from an activityId.

        Get an xAPI state data from an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param state_id: The xAPI state ID (required)
        :type state_id: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_get_state_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            state_id=state_id,
            registration=registration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_xapi_get_state_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_xapi_get_state_with_http_info(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        state_id: Annotated[Optional[StrictStr], Field(description="The xAPI state ID")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """Get an xAPI state data from an activityId.

        Get an xAPI state data from an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param state_id: The xAPI state ID (required)
        :type state_id: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_get_state_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            state_id=state_id,
            registration=registration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_xapi_get_state_without_preload_content(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        state_id: Annotated[Optional[StrictStr], Field(description="The xAPI state ID")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get an xAPI state data from an activityId.

        Get an xAPI state data from an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param state_id: The xAPI state ID (required)
        :type state_id: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_get_state_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            state_id=state_id,
            registration=registration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_xapi_get_state_serialize(
        self,
        activity_id,
        agent,
        component,
        state_id,
        registration,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_xapi_get_state'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_xapi_get_state'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_xapi_get_state',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if activity_id is not None:
            _form_params += parse_form({'activityId': activity_id})
        if agent is not None:
            _form_params += parse_form({'agent': agent})
        if component is not None:
            _form_params += parse_form({'component': component})
        if registration is not None:
            _form_params += parse_form({'registration': registration})
        if state_id is not None:
            _form_params += parse_form({'stateId': state_id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_xapi_get_states_args(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        since: Annotated[Optional[StrictStr], Field(description="Filter ids stored since the timestamp (exclusive)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get all state ID from an activityId.

        Get all state ID from an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param since: Filter ids stored since the timestamp (exclusive)
        :type since: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_get_states_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            registration=registration,
            since=since,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[Optional[str]]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_xapi_get_states(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        since: Annotated[Optional[StrictStr], Field(description="Filter ids stored since the timestamp (exclusive)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[Optional[str]]:
        """Get all state ID from an activityId.

        Get all state ID from an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param since: Filter ids stored since the timestamp (exclusive)
        :type since: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_get_states_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            registration=registration,
            since=since,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[Optional[str]]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_xapi_get_states_from_args(
        self,
        args
    ) -> List[Optional[str]]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[Optional[str]]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_xapi_get_states_with_http_info(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        since: Annotated[Optional[StrictStr], Field(description="Filter ids stored since the timestamp (exclusive)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[Optional[str]]]:
        """Get all state ID from an activityId.

        Get all state ID from an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param since: Filter ids stored since the timestamp (exclusive)
        :type since: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_get_states_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            registration=registration,
            since=since,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[Optional[str]]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_xapi_get_states_without_preload_content(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        since: Annotated[Optional[StrictStr], Field(description="Filter ids stored since the timestamp (exclusive)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get all state ID from an activityId.

        Get all state ID from an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param since: Filter ids stored since the timestamp (exclusive)
        :type since: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_get_states_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            registration=registration,
            since=since,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[Optional[str]]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_xapi_get_states_serialize(
        self,
        activity_id,
        agent,
        component,
        registration,
        since,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_xapi_get_states'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_xapi_get_states'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_xapi_get_states',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if activity_id is not None:
            _form_params += parse_form({'activityId': activity_id})
        if agent is not None:
            _form_params += parse_form({'agent': agent})
        if component is not None:
            _form_params += parse_form({'component': component})
        if registration is not None:
            _form_params += parse_form({'registration': registration})
        if since is not None:
            _form_params += parse_form({'since': since})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_xapi_post_state_args(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        state_data: Annotated[Optional[StrictStr], Field(description="JSON object with the state data")],
        state_id: Annotated[Optional[StrictStr], Field(description="The xAPI state ID")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Post an xAPI state into an activityId.

        Post an xAPI state into an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param state_data: JSON object with the state data (required)
        :type state_data: str
        :param state_id: The xAPI state ID (required)
        :type state_id: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_post_state_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            state_data=state_data,
            state_id=state_id,
            registration=registration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_xapi_post_state(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        state_data: Annotated[Optional[StrictStr], Field(description="JSON object with the state data")],
        state_id: Annotated[Optional[StrictStr], Field(description="The xAPI state ID")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Post an xAPI state into an activityId.

        Post an xAPI state into an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param state_data: JSON object with the state data (required)
        :type state_data: str
        :param state_id: The xAPI state ID (required)
        :type state_id: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_post_state_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            state_data=state_data,
            state_id=state_id,
            registration=registration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_xapi_post_state_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_xapi_post_state_with_http_info(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        state_data: Annotated[Optional[StrictStr], Field(description="JSON object with the state data")],
        state_id: Annotated[Optional[StrictStr], Field(description="The xAPI state ID")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Post an xAPI state into an activityId.

        Post an xAPI state into an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param state_data: JSON object with the state data (required)
        :type state_data: str
        :param state_id: The xAPI state ID (required)
        :type state_id: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_post_state_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            state_data=state_data,
            state_id=state_id,
            registration=registration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_xapi_post_state_without_preload_content(
        self,
        activity_id: Annotated[Optional[StrictStr], Field(description="xAPI activity ID IRI")],
        agent: Annotated[Optional[StrictStr], Field(description="The xAPI agent json")],
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        state_data: Annotated[Optional[StrictStr], Field(description="JSON object with the state data")],
        state_id: Annotated[Optional[StrictStr], Field(description="The xAPI state ID")],
        registration: Annotated[Optional[StrictStr], Field(description="The xAPI registration UUID")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Post an xAPI state into an activityId.

        Post an xAPI state into an activityId.

        :param activity_id: xAPI activity ID IRI (required)
        :type activity_id: str
        :param agent: The xAPI agent json (required)
        :type agent: str
        :param component: Component name (required)
        :type component: str
        :param state_data: JSON object with the state data (required)
        :type state_data: str
        :param state_id: The xAPI state ID (required)
        :type state_id: str
        :param registration: The xAPI registration UUID
        :type registration: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_post_state_serialize(
            activity_id=activity_id,
            agent=agent,
            component=component,
            state_data=state_data,
            state_id=state_id,
            registration=registration,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_xapi_post_state_serialize(
        self,
        activity_id,
        agent,
        component,
        state_data,
        state_id,
        registration,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_xapi_post_state'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_xapi_post_state'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_xapi_post_state',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if activity_id is not None:
            _form_params += parse_form({'activityId': activity_id})
        if agent is not None:
            _form_params += parse_form({'agent': agent})
        if component is not None:
            _form_params += parse_form({'component': component})
        if registration is not None:
            _form_params += parse_form({'registration': registration})
        if state_data is not None:
            _form_params += parse_form({'stateData': state_data})
        if state_id is not None:
            _form_params += parse_form({'stateId': state_id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def core_xapi_statement_post_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        requestjson: Annotated[Optional[StrictStr], Field(description="json object with all the statements to post")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Post an xAPI statement.

        Post an xAPI statement.

        :param component: Component name (required)
        :type component: str
        :param requestjson: json object with all the statements to post (required)
        :type requestjson: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_statement_post_serialize(
            component=component,
            requestjson=requestjson,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[Optional[bool]]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def core_xapi_statement_post(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        requestjson: Annotated[Optional[StrictStr], Field(description="json object with all the statements to post")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[Optional[bool]]:
        """Post an xAPI statement.

        Post an xAPI statement.

        :param component: Component name (required)
        :type component: str
        :param requestjson: json object with all the statements to post (required)
        :type requestjson: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_statement_post_serialize(
            component=component,
            requestjson=requestjson,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[Optional[bool]]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_xapi_statement_post_from_args(
        self,
        args
    ) -> List[Optional[bool]]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[Optional[bool]]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def core_xapi_statement_post_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        requestjson: Annotated[Optional[StrictStr], Field(description="json object with all the statements to post")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[Optional[bool]]]:
        """Post an xAPI statement.

        Post an xAPI statement.

        :param component: Component name (required)
        :type component: str
        :param requestjson: json object with all the statements to post (required)
        :type requestjson: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_statement_post_serialize(
            component=component,
            requestjson=requestjson,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[Optional[bool]]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def core_xapi_statement_post_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component name")],
        requestjson: Annotated[Optional[StrictStr], Field(description="json object with all the statements to post")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Post an xAPI statement.

        Post an xAPI statement.

        :param component: Component name (required)
        :type component: str
        :param requestjson: json object with all the statements to post (required)
        :type requestjson: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._core_xapi_statement_post_serialize(
            component=component,
            requestjson=requestjson,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[Optional[bool]]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _core_xapi_statement_post_serialize(
        self,
        component,
        requestjson,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#core_xapi_statement_post'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'core_xapi_statement_post'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'core_xapi_statement_post',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if component is not None:
            _form_params += parse_form({'component': component})
        if requestjson is not None:
            _form_params += parse_form({'requestjson': requestjson})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def customfield_number_recalculate_value_args(
        self,
        fieldid: Annotated[Optional[StrictInt], Field(description="Field id")],
        instanceid: Annotated[Optional[StrictInt], Field(description="Instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """This web service is used to recalculate the value of automatically populated number custom field.

        This web service is used to recalculate the value of automatically populated number custom field.

        :param fieldid: Field id (required)
        :type fieldid: int
        :param instanceid: Instance id (required)
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._customfield_number_recalculate_value_serialize(
            fieldid=fieldid,
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CustomfieldNumberRecalculateValueResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def customfield_number_recalculate_value(
        self,
        fieldid: Annotated[Optional[StrictInt], Field(description="Field id")],
        instanceid: Annotated[Optional[StrictInt], Field(description="Instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CustomfieldNumberRecalculateValueResponse:
        """This web service is used to recalculate the value of automatically populated number custom field.

        This web service is used to recalculate the value of automatically populated number custom field.

        :param fieldid: Field id (required)
        :type fieldid: int
        :param instanceid: Instance id (required)
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._customfield_number_recalculate_value_serialize(
            fieldid=fieldid,
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CustomfieldNumberRecalculateValueResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def customfield_number_recalculate_value_from_args(
        self,
        args
    ) -> CustomfieldNumberRecalculateValueResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CustomfieldNumberRecalculateValueResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def customfield_number_recalculate_value_with_http_info(
        self,
        fieldid: Annotated[Optional[StrictInt], Field(description="Field id")],
        instanceid: Annotated[Optional[StrictInt], Field(description="Instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CustomfieldNumberRecalculateValueResponse]:
        """This web service is used to recalculate the value of automatically populated number custom field.

        This web service is used to recalculate the value of automatically populated number custom field.

        :param fieldid: Field id (required)
        :type fieldid: int
        :param instanceid: Instance id (required)
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._customfield_number_recalculate_value_serialize(
            fieldid=fieldid,
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CustomfieldNumberRecalculateValueResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def customfield_number_recalculate_value_without_preload_content(
        self,
        fieldid: Annotated[Optional[StrictInt], Field(description="Field id")],
        instanceid: Annotated[Optional[StrictInt], Field(description="Instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """This web service is used to recalculate the value of automatically populated number custom field.

        This web service is used to recalculate the value of automatically populated number custom field.

        :param fieldid: Field id (required)
        :type fieldid: int
        :param instanceid: Instance id (required)
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._customfield_number_recalculate_value_serialize(
            fieldid=fieldid,
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CustomfieldNumberRecalculateValueResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _customfield_number_recalculate_value_serialize(
        self,
        fieldid,
        instanceid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#customfield_number_recalculate_value'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'customfield_number_recalculate_value'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'customfield_number_recalculate_value',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if fieldid is not None:
            _form_params += parse_form({'fieldid': fieldid})
        if instanceid is not None:
            _form_params += parse_form({'instanceid': instanceid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def editor_tiny_get_configuration_args(
        self,
        contextlevel: Annotated[Optional[StrictStr], Field(description="Context level: system, user, coursecat, course, module or block")],
        instanceid: Annotated[Optional[StrictInt], Field(description="Instance ID of the context (e.g. course ID)")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the TinyMCE configuration for a context.

        Returns the TinyMCE configuration for a context.

        :param contextlevel: Context level: system, user, coursecat, course, module or block (required)
        :type contextlevel: str
        :param instanceid: Instance ID of the context (e.g. course ID) (required)
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._editor_tiny_get_configuration_serialize(
            contextlevel=contextlevel,
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EditorTinyGetConfigurationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def editor_tiny_get_configuration(
        self,
        contextlevel: Annotated[Optional[StrictStr], Field(description="Context level: system, user, coursecat, course, module or block")],
        instanceid: Annotated[Optional[StrictInt], Field(description="Instance ID of the context (e.g. course ID)")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> EditorTinyGetConfigurationResponse:
        """Returns the TinyMCE configuration for a context.

        Returns the TinyMCE configuration for a context.

        :param contextlevel: Context level: system, user, coursecat, course, module or block (required)
        :type contextlevel: str
        :param instanceid: Instance ID of the context (e.g. course ID) (required)
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._editor_tiny_get_configuration_serialize(
            contextlevel=contextlevel,
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EditorTinyGetConfigurationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def editor_tiny_get_configuration_from_args(
        self,
        args
    ) -> EditorTinyGetConfigurationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EditorTinyGetConfigurationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def editor_tiny_get_configuration_with_http_info(
        self,
        contextlevel: Annotated[Optional[StrictStr], Field(description="Context level: system, user, coursecat, course, module or block")],
        instanceid: Annotated[Optional[StrictInt], Field(description="Instance ID of the context (e.g. course ID)")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[EditorTinyGetConfigurationResponse]:
        """Returns the TinyMCE configuration for a context.

        Returns the TinyMCE configuration for a context.

        :param contextlevel: Context level: system, user, coursecat, course, module or block (required)
        :type contextlevel: str
        :param instanceid: Instance ID of the context (e.g. course ID) (required)
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._editor_tiny_get_configuration_serialize(
            contextlevel=contextlevel,
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EditorTinyGetConfigurationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def editor_tiny_get_configuration_without_preload_content(
        self,
        contextlevel: Annotated[Optional[StrictStr], Field(description="Context level: system, user, coursecat, course, module or block")],
        instanceid: Annotated[Optional[StrictInt], Field(description="Instance ID of the context (e.g. course ID)")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the TinyMCE configuration for a context.

        Returns the TinyMCE configuration for a context.

        :param contextlevel: Context level: system, user, coursecat, course, module or block (required)
        :type contextlevel: str
        :param instanceid: Instance ID of the context (e.g. course ID) (required)
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._editor_tiny_get_configuration_serialize(
            contextlevel=contextlevel,
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EditorTinyGetConfigurationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _editor_tiny_get_configuration_serialize(
        self,
        contextlevel,
        instanceid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#editor_tiny_get_configuration'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'editor_tiny_get_configuration'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'editor_tiny_get_configuration',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if contextlevel is not None:
            _form_params += parse_form({'contextlevel': contextlevel})
        if instanceid is not None:
            _form_params += parse_form({'instanceid': instanceid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def enrol_guest_get_instance_info_args(
        self,
        instanceid: Annotated[Optional[StrictInt], Field(description="Instance id of guest enrolment plugin.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return guest enrolment instance information.

        Return guest enrolment instance information.

        :param instanceid: Instance id of guest enrolment plugin. (required)
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_guest_get_instance_info_serialize(
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolGuestGetInstanceInfoResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def enrol_guest_get_instance_info(
        self,
        instanceid: Annotated[Optional[StrictInt], Field(description="Instance id of guest enrolment plugin.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> EnrolGuestGetInstanceInfoResponse:
        """Return guest enrolment instance information.

        Return guest enrolment instance information.

        :param instanceid: Instance id of guest enrolment plugin. (required)
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_guest_get_instance_info_serialize(
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolGuestGetInstanceInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def enrol_guest_get_instance_info_from_args(
        self,
        args
    ) -> EnrolGuestGetInstanceInfoResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolGuestGetInstanceInfoResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def enrol_guest_get_instance_info_with_http_info(
        self,
        instanceid: Annotated[Optional[StrictInt], Field(description="Instance id of guest enrolment plugin.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[EnrolGuestGetInstanceInfoResponse]:
        """Return guest enrolment instance information.

        Return guest enrolment instance information.

        :param instanceid: Instance id of guest enrolment plugin. (required)
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_guest_get_instance_info_serialize(
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolGuestGetInstanceInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def enrol_guest_get_instance_info_without_preload_content(
        self,
        instanceid: Annotated[Optional[StrictInt], Field(description="Instance id of guest enrolment plugin.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return guest enrolment instance information.

        Return guest enrolment instance information.

        :param instanceid: Instance id of guest enrolment plugin. (required)
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_guest_get_instance_info_serialize(
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolGuestGetInstanceInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _enrol_guest_get_instance_info_serialize(
        self,
        instanceid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#enrol_guest_get_instance_info'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'enrol_guest_get_instance_info'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'enrol_guest_get_instance_info',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if instanceid is not None:
            _form_params += parse_form({'instanceid': instanceid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def enrol_guest_validate_password_args(
        self,
        instanceid: Annotated[Optional[StrictInt], Field(description="instance id of guest enrolment plugin")],
        password: Annotated[Optional[StrictStr], Field(description="the course password")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Perform password validation.

        Perform password validation.

        :param instanceid: instance id of guest enrolment plugin (required)
        :type instanceid: int
        :param password: the course password (required)
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_guest_validate_password_serialize(
            instanceid=instanceid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolGuestValidatePasswordResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def enrol_guest_validate_password(
        self,
        instanceid: Annotated[Optional[StrictInt], Field(description="instance id of guest enrolment plugin")],
        password: Annotated[Optional[StrictStr], Field(description="the course password")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> EnrolGuestValidatePasswordResponse:
        """Perform password validation.

        Perform password validation.

        :param instanceid: instance id of guest enrolment plugin (required)
        :type instanceid: int
        :param password: the course password (required)
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_guest_validate_password_serialize(
            instanceid=instanceid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolGuestValidatePasswordResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def enrol_guest_validate_password_from_args(
        self,
        args
    ) -> EnrolGuestValidatePasswordResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolGuestValidatePasswordResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def enrol_guest_validate_password_with_http_info(
        self,
        instanceid: Annotated[Optional[StrictInt], Field(description="instance id of guest enrolment plugin")],
        password: Annotated[Optional[StrictStr], Field(description="the course password")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[EnrolGuestValidatePasswordResponse]:
        """Perform password validation.

        Perform password validation.

        :param instanceid: instance id of guest enrolment plugin (required)
        :type instanceid: int
        :param password: the course password (required)
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_guest_validate_password_serialize(
            instanceid=instanceid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolGuestValidatePasswordResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def enrol_guest_validate_password_without_preload_content(
        self,
        instanceid: Annotated[Optional[StrictInt], Field(description="instance id of guest enrolment plugin")],
        password: Annotated[Optional[StrictStr], Field(description="the course password")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Perform password validation.

        Perform password validation.

        :param instanceid: instance id of guest enrolment plugin (required)
        :type instanceid: int
        :param password: the course password (required)
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_guest_validate_password_serialize(
            instanceid=instanceid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolGuestValidatePasswordResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _enrol_guest_validate_password_serialize(
        self,
        instanceid,
        password,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#enrol_guest_validate_password'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'enrol_guest_validate_password'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'enrol_guest_validate_password',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if instanceid is not None:
            _form_params += parse_form({'instanceid': instanceid})
        if password is not None:
            _form_params += parse_form({'password': password})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def enrol_manual_enrol_users_args(
        self,
        enrolments: List[EnrolManualEnrolUsersParametersEnrolmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Manual enrol users

        Manual enrol users

        :param enrolments: (required)
        :type enrolments: List[EnrolManualEnrolUsersParametersEnrolmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_manual_enrol_users_serialize(
            enrolments=enrolments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def enrol_manual_enrol_users(
        self,
        enrolments: List[EnrolManualEnrolUsersParametersEnrolmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Manual enrol users

        Manual enrol users

        :param enrolments: (required)
        :type enrolments: List[EnrolManualEnrolUsersParametersEnrolmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_manual_enrol_users_serialize(
            enrolments=enrolments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def enrol_manual_enrol_users_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def enrol_manual_enrol_users_with_http_info(
        self,
        enrolments: List[EnrolManualEnrolUsersParametersEnrolmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Manual enrol users

        Manual enrol users

        :param enrolments: (required)
        :type enrolments: List[EnrolManualEnrolUsersParametersEnrolmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_manual_enrol_users_serialize(
            enrolments=enrolments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def enrol_manual_enrol_users_without_preload_content(
        self,
        enrolments: List[EnrolManualEnrolUsersParametersEnrolmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Manual enrol users

        Manual enrol users

        :param enrolments: (required)
        :type enrolments: List[EnrolManualEnrolUsersParametersEnrolmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_manual_enrol_users_serialize(
            enrolments=enrolments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _enrol_manual_enrol_users_serialize(
        self,
        enrolments,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'enrolments': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#enrol_manual_enrol_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'enrol_manual_enrol_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'enrol_manual_enrol_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if enrolments is not None:
            _form_params += parse_form({'enrolments': enrolments})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def enrol_manual_unenrol_users_args(
        self,
        enrolments: List[EnrolManualUnenrolUsersParametersEnrolmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Manual unenrol users

        Manual unenrol users

        :param enrolments: (required)
        :type enrolments: List[EnrolManualUnenrolUsersParametersEnrolmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_manual_unenrol_users_serialize(
            enrolments=enrolments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def enrol_manual_unenrol_users(
        self,
        enrolments: List[EnrolManualUnenrolUsersParametersEnrolmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Manual unenrol users

        Manual unenrol users

        :param enrolments: (required)
        :type enrolments: List[EnrolManualUnenrolUsersParametersEnrolmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_manual_unenrol_users_serialize(
            enrolments=enrolments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def enrol_manual_unenrol_users_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def enrol_manual_unenrol_users_with_http_info(
        self,
        enrolments: List[EnrolManualUnenrolUsersParametersEnrolmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Manual unenrol users

        Manual unenrol users

        :param enrolments: (required)
        :type enrolments: List[EnrolManualUnenrolUsersParametersEnrolmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_manual_unenrol_users_serialize(
            enrolments=enrolments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def enrol_manual_unenrol_users_without_preload_content(
        self,
        enrolments: List[EnrolManualUnenrolUsersParametersEnrolmentsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Manual unenrol users

        Manual unenrol users

        :param enrolments: (required)
        :type enrolments: List[EnrolManualUnenrolUsersParametersEnrolmentsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_manual_unenrol_users_serialize(
            enrolments=enrolments,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _enrol_manual_unenrol_users_serialize(
        self,
        enrolments,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'enrolments': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#enrol_manual_unenrol_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'enrol_manual_unenrol_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'enrol_manual_unenrol_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if enrolments is not None:
            _form_params += parse_form({'enrolments': enrolments})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def enrol_meta_add_instances_args(
        self,
        instances: Annotated[Optional[List[EnrolMetaAddInstancesParametersInstancesInner]], Field(description="List of course meta enrolment instances to create.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Add meta enrolment instances

        Add meta enrolment instances

        :param instances: List of course meta enrolment instances to create.
        :type instances: List[EnrolMetaAddInstancesParametersInstancesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_meta_add_instances_serialize(
            instances=instances,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EnrolMetaAddInstancesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def enrol_meta_add_instances(
        self,
        instances: Annotated[Optional[List[EnrolMetaAddInstancesParametersInstancesInner]], Field(description="List of course meta enrolment instances to create.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[EnrolMetaAddInstancesResponseInner]:
        """Add meta enrolment instances

        Add meta enrolment instances

        :param instances: List of course meta enrolment instances to create.
        :type instances: List[EnrolMetaAddInstancesParametersInstancesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_meta_add_instances_serialize(
            instances=instances,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EnrolMetaAddInstancesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def enrol_meta_add_instances_from_args(
        self,
        args
    ) -> List[EnrolMetaAddInstancesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EnrolMetaAddInstancesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def enrol_meta_add_instances_with_http_info(
        self,
        instances: Annotated[Optional[List[EnrolMetaAddInstancesParametersInstancesInner]], Field(description="List of course meta enrolment instances to create.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[EnrolMetaAddInstancesResponseInner]]:
        """Add meta enrolment instances

        Add meta enrolment instances

        :param instances: List of course meta enrolment instances to create.
        :type instances: List[EnrolMetaAddInstancesParametersInstancesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_meta_add_instances_serialize(
            instances=instances,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EnrolMetaAddInstancesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def enrol_meta_add_instances_without_preload_content(
        self,
        instances: Annotated[Optional[List[EnrolMetaAddInstancesParametersInstancesInner]], Field(description="List of course meta enrolment instances to create.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Add meta enrolment instances

        Add meta enrolment instances

        :param instances: List of course meta enrolment instances to create.
        :type instances: List[EnrolMetaAddInstancesParametersInstancesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_meta_add_instances_serialize(
            instances=instances,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EnrolMetaAddInstancesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _enrol_meta_add_instances_serialize(
        self,
        instances,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'instances': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#enrol_meta_add_instances'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'enrol_meta_add_instances'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'enrol_meta_add_instances',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if instances is not None:
            _form_params += parse_form({'instances': instances})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def enrol_meta_delete_instances_args(
        self,
        instances: Annotated[Optional[List[EnrolMetaDeleteInstancesParametersInstancesInner]], Field(description="List of course meta enrolment instances to delete.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete meta enrolment instances

        Delete meta enrolment instances

        :param instances: List of course meta enrolment instances to delete.
        :type instances: List[EnrolMetaDeleteInstancesParametersInstancesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_meta_delete_instances_serialize(
            instances=instances,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EnrolMetaDeleteInstancesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def enrol_meta_delete_instances(
        self,
        instances: Annotated[Optional[List[EnrolMetaDeleteInstancesParametersInstancesInner]], Field(description="List of course meta enrolment instances to delete.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[EnrolMetaDeleteInstancesResponseInner]:
        """Delete meta enrolment instances

        Delete meta enrolment instances

        :param instances: List of course meta enrolment instances to delete.
        :type instances: List[EnrolMetaDeleteInstancesParametersInstancesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_meta_delete_instances_serialize(
            instances=instances,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EnrolMetaDeleteInstancesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def enrol_meta_delete_instances_from_args(
        self,
        args
    ) -> List[EnrolMetaDeleteInstancesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EnrolMetaDeleteInstancesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def enrol_meta_delete_instances_with_http_info(
        self,
        instances: Annotated[Optional[List[EnrolMetaDeleteInstancesParametersInstancesInner]], Field(description="List of course meta enrolment instances to delete.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[EnrolMetaDeleteInstancesResponseInner]]:
        """Delete meta enrolment instances

        Delete meta enrolment instances

        :param instances: List of course meta enrolment instances to delete.
        :type instances: List[EnrolMetaDeleteInstancesParametersInstancesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_meta_delete_instances_serialize(
            instances=instances,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EnrolMetaDeleteInstancesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def enrol_meta_delete_instances_without_preload_content(
        self,
        instances: Annotated[Optional[List[EnrolMetaDeleteInstancesParametersInstancesInner]], Field(description="List of course meta enrolment instances to delete.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete meta enrolment instances

        Delete meta enrolment instances

        :param instances: List of course meta enrolment instances to delete.
        :type instances: List[EnrolMetaDeleteInstancesParametersInstancesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_meta_delete_instances_serialize(
            instances=instances,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EnrolMetaDeleteInstancesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _enrol_meta_delete_instances_serialize(
        self,
        instances,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'instances': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#enrol_meta_delete_instances'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'enrol_meta_delete_instances'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'enrol_meta_delete_instances',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if instances is not None:
            _form_params += parse_form({'instances': instances})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def enrol_self_enrol_user_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Id of the course")],
        instanceid: Annotated[Optional[StrictInt], Field(description="Instance id of self enrolment plugin.")] = None,
        password: Annotated[Optional[StrictStr], Field(description="Enrolment key")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Self enrol the current user in the given course.

        Self enrol the current user in the given course.

        :param courseid: Id of the course (required)
        :type courseid: int
        :param instanceid: Instance id of self enrolment plugin.
        :type instanceid: int
        :param password: Enrolment key
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_self_enrol_user_serialize(
            courseid=courseid,
            instanceid=instanceid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolSelfEnrolUserResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def enrol_self_enrol_user(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Id of the course")],
        instanceid: Annotated[Optional[StrictInt], Field(description="Instance id of self enrolment plugin.")] = None,
        password: Annotated[Optional[StrictStr], Field(description="Enrolment key")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> EnrolSelfEnrolUserResponse:
        """Self enrol the current user in the given course.

        Self enrol the current user in the given course.

        :param courseid: Id of the course (required)
        :type courseid: int
        :param instanceid: Instance id of self enrolment plugin.
        :type instanceid: int
        :param password: Enrolment key
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_self_enrol_user_serialize(
            courseid=courseid,
            instanceid=instanceid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolSelfEnrolUserResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def enrol_self_enrol_user_from_args(
        self,
        args
    ) -> EnrolSelfEnrolUserResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolSelfEnrolUserResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def enrol_self_enrol_user_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Id of the course")],
        instanceid: Annotated[Optional[StrictInt], Field(description="Instance id of self enrolment plugin.")] = None,
        password: Annotated[Optional[StrictStr], Field(description="Enrolment key")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[EnrolSelfEnrolUserResponse]:
        """Self enrol the current user in the given course.

        Self enrol the current user in the given course.

        :param courseid: Id of the course (required)
        :type courseid: int
        :param instanceid: Instance id of self enrolment plugin.
        :type instanceid: int
        :param password: Enrolment key
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_self_enrol_user_serialize(
            courseid=courseid,
            instanceid=instanceid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolSelfEnrolUserResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def enrol_self_enrol_user_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Id of the course")],
        instanceid: Annotated[Optional[StrictInt], Field(description="Instance id of self enrolment plugin.")] = None,
        password: Annotated[Optional[StrictStr], Field(description="Enrolment key")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Self enrol the current user in the given course.

        Self enrol the current user in the given course.

        :param courseid: Id of the course (required)
        :type courseid: int
        :param instanceid: Instance id of self enrolment plugin.
        :type instanceid: int
        :param password: Enrolment key
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_self_enrol_user_serialize(
            courseid=courseid,
            instanceid=instanceid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolSelfEnrolUserResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _enrol_self_enrol_user_serialize(
        self,
        courseid,
        instanceid,
        password,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#enrol_self_enrol_user'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'enrol_self_enrol_user'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'enrol_self_enrol_user',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if instanceid is not None:
            _form_params += parse_form({'instanceid': instanceid})
        if password is not None:
            _form_params += parse_form({'password': password})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def enrol_self_get_instance_info_args(
        self,
        instanceid: Annotated[Optional[StrictInt], Field(description="instance id of self enrolment plugin.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """self enrolment instance information.

        self enrolment instance information.

        :param instanceid: instance id of self enrolment plugin. (required)
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_self_get_instance_info_serialize(
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolSelfGetInstanceInfoResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def enrol_self_get_instance_info(
        self,
        instanceid: Annotated[Optional[StrictInt], Field(description="instance id of self enrolment plugin.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> EnrolSelfGetInstanceInfoResponse:
        """self enrolment instance information.

        self enrolment instance information.

        :param instanceid: instance id of self enrolment plugin. (required)
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_self_get_instance_info_serialize(
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolSelfGetInstanceInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def enrol_self_get_instance_info_from_args(
        self,
        args
    ) -> EnrolSelfGetInstanceInfoResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolSelfGetInstanceInfoResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def enrol_self_get_instance_info_with_http_info(
        self,
        instanceid: Annotated[Optional[StrictInt], Field(description="instance id of self enrolment plugin.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[EnrolSelfGetInstanceInfoResponse]:
        """self enrolment instance information.

        self enrolment instance information.

        :param instanceid: instance id of self enrolment plugin. (required)
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_self_get_instance_info_serialize(
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolSelfGetInstanceInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def enrol_self_get_instance_info_without_preload_content(
        self,
        instanceid: Annotated[Optional[StrictInt], Field(description="instance id of self enrolment plugin.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """self enrolment instance information.

        self enrolment instance information.

        :param instanceid: instance id of self enrolment plugin. (required)
        :type instanceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._enrol_self_get_instance_info_serialize(
            instanceid=instanceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EnrolSelfGetInstanceInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _enrol_self_get_instance_info_serialize(
        self,
        instanceid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#enrol_self_get_instance_info'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'enrol_self_get_instance_info'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'enrol_self_get_instance_info',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if instanceid is not None:
            _form_params += parse_form({'instanceid': instanceid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def gradereport_grader_get_users_in_report_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the dataset of users within the report

        Returns the dataset of users within the report

        :param courseid: Course ID (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_grader_get_users_in_report_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportGraderGetUsersInReportResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def gradereport_grader_get_users_in_report(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GradereportGraderGetUsersInReportResponse:
        """Returns the dataset of users within the report

        Returns the dataset of users within the report

        :param courseid: Course ID (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_grader_get_users_in_report_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportGraderGetUsersInReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradereport_grader_get_users_in_report_from_args(
        self,
        args
    ) -> GradereportGraderGetUsersInReportResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportGraderGetUsersInReportResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradereport_grader_get_users_in_report_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GradereportGraderGetUsersInReportResponse]:
        """Returns the dataset of users within the report

        Returns the dataset of users within the report

        :param courseid: Course ID (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_grader_get_users_in_report_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportGraderGetUsersInReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def gradereport_grader_get_users_in_report_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the dataset of users within the report

        Returns the dataset of users within the report

        :param courseid: Course ID (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_grader_get_users_in_report_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportGraderGetUsersInReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _gradereport_grader_get_users_in_report_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#gradereport_grader_get_users_in_report'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'gradereport_grader_get_users_in_report'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'gradereport_grader_get_users_in_report',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def gradereport_overview_get_course_grades_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="Get grades for this user (optional, default current)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the given user courses final grades

        Get the given user courses final grades

        :param userid: Get grades for this user (optional, default current)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_overview_get_course_grades_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportOverviewGetCourseGradesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def gradereport_overview_get_course_grades(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="Get grades for this user (optional, default current)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GradereportOverviewGetCourseGradesResponse:
        """Get the given user courses final grades

        Get the given user courses final grades

        :param userid: Get grades for this user (optional, default current)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_overview_get_course_grades_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportOverviewGetCourseGradesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradereport_overview_get_course_grades_from_args(
        self,
        args
    ) -> GradereportOverviewGetCourseGradesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportOverviewGetCourseGradesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradereport_overview_get_course_grades_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="Get grades for this user (optional, default current)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GradereportOverviewGetCourseGradesResponse]:
        """Get the given user courses final grades

        Get the given user courses final grades

        :param userid: Get grades for this user (optional, default current)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_overview_get_course_grades_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportOverviewGetCourseGradesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def gradereport_overview_get_course_grades_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="Get grades for this user (optional, default current)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the given user courses final grades

        Get the given user courses final grades

        :param userid: Get grades for this user (optional, default current)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_overview_get_course_grades_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportOverviewGetCourseGradesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _gradereport_overview_get_course_grades_serialize(
        self,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#gradereport_overview_get_course_grades'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'gradereport_overview_get_course_grades'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'gradereport_overview_get_course_grades',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def gradereport_overview_view_grade_report_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course")],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 means current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the report view event

        Trigger the report view event

        :param courseid: id of the course (required)
        :type courseid: int
        :param userid: id of the user, 0 means current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_overview_view_grade_report_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportOverviewViewGradeReportResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def gradereport_overview_view_grade_report(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course")],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 means current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GradereportOverviewViewGradeReportResponse:
        """Trigger the report view event

        Trigger the report view event

        :param courseid: id of the course (required)
        :type courseid: int
        :param userid: id of the user, 0 means current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_overview_view_grade_report_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportOverviewViewGradeReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradereport_overview_view_grade_report_from_args(
        self,
        args
    ) -> GradereportOverviewViewGradeReportResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportOverviewViewGradeReportResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradereport_overview_view_grade_report_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course")],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 means current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GradereportOverviewViewGradeReportResponse]:
        """Trigger the report view event

        Trigger the report view event

        :param courseid: id of the course (required)
        :type courseid: int
        :param userid: id of the user, 0 means current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_overview_view_grade_report_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportOverviewViewGradeReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def gradereport_overview_view_grade_report_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course")],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 means current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the report view event

        Trigger the report view event

        :param courseid: id of the course (required)
        :type courseid: int
        :param userid: id of the user, 0 means current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_overview_view_grade_report_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportOverviewViewGradeReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _gradereport_overview_view_grade_report_serialize(
        self,
        courseid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#gradereport_overview_view_grade_report'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'gradereport_overview_view_grade_report'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'gradereport_overview_view_grade_report',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def gradereport_singleview_get_grade_items_for_search_widget_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the gradeitem/(s) for a course

        Get the gradeitem/(s) for a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_singleview_get_grade_items_for_search_widget_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportSingleviewGetGradeItemsForSearchWidgetResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def gradereport_singleview_get_grade_items_for_search_widget(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GradereportSingleviewGetGradeItemsForSearchWidgetResponse:
        """Get the gradeitem/(s) for a course

        Get the gradeitem/(s) for a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_singleview_get_grade_items_for_search_widget_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportSingleviewGetGradeItemsForSearchWidgetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradereport_singleview_get_grade_items_for_search_widget_from_args(
        self,
        args
    ) -> GradereportSingleviewGetGradeItemsForSearchWidgetResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportSingleviewGetGradeItemsForSearchWidgetResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradereport_singleview_get_grade_items_for_search_widget_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GradereportSingleviewGetGradeItemsForSearchWidgetResponse]:
        """Get the gradeitem/(s) for a course

        Get the gradeitem/(s) for a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_singleview_get_grade_items_for_search_widget_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportSingleviewGetGradeItemsForSearchWidgetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def gradereport_singleview_get_grade_items_for_search_widget_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the gradeitem/(s) for a course

        Get the gradeitem/(s) for a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_singleview_get_grade_items_for_search_widget_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportSingleviewGetGradeItemsForSearchWidgetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _gradereport_singleview_get_grade_items_for_search_widget_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#gradereport_singleview_get_grade_items_for_search_widget'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'gradereport_singleview_get_grade_items_for_search_widget'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'gradereport_singleview_get_grade_items_for_search_widget',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def gradereport_user_get_access_information_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course to check.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns user access information for the user grade report.

        Returns user access information for the user grade report.

        :param courseid: Course to check. (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_user_get_access_information_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserGetAccessInformationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def gradereport_user_get_access_information(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course to check.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GradereportUserGetAccessInformationResponse:
        """Returns user access information for the user grade report.

        Returns user access information for the user grade report.

        :param courseid: Course to check. (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_user_get_access_information_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserGetAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradereport_user_get_access_information_from_args(
        self,
        args
    ) -> GradereportUserGetAccessInformationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserGetAccessInformationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradereport_user_get_access_information_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course to check.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GradereportUserGetAccessInformationResponse]:
        """Returns user access information for the user grade report.

        Returns user access information for the user grade report.

        :param courseid: Course to check. (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_user_get_access_information_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserGetAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def gradereport_user_get_access_information_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course to check.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns user access information for the user grade report.

        Returns user access information for the user grade report.

        :param courseid: Course to check. (required)
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_user_get_access_information_serialize(
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserGetAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _gradereport_user_get_access_information_serialize(
        self,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#gradereport_user_get_access_information'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'gradereport_user_get_access_information'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'gradereport_user_get_access_information',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def gradereport_user_get_grade_items_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Get users from this group only")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Return grades only for this user (optional)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the complete list of grade items for users in a course

        Returns the complete list of grade items for users in a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param groupid: Get users from this group only
        :type groupid: int
        :param userid: Return grades only for this user (optional)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_user_get_grade_items_serialize(
            courseid=courseid,
            groupid=groupid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserGetGradeItemsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def gradereport_user_get_grade_items(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Get users from this group only")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Return grades only for this user (optional)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GradereportUserGetGradeItemsResponse:
        """Returns the complete list of grade items for users in a course

        Returns the complete list of grade items for users in a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param groupid: Get users from this group only
        :type groupid: int
        :param userid: Return grades only for this user (optional)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_user_get_grade_items_serialize(
            courseid=courseid,
            groupid=groupid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserGetGradeItemsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradereport_user_get_grade_items_from_args(
        self,
        args
    ) -> GradereportUserGetGradeItemsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserGetGradeItemsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradereport_user_get_grade_items_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Get users from this group only")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Return grades only for this user (optional)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GradereportUserGetGradeItemsResponse]:
        """Returns the complete list of grade items for users in a course

        Returns the complete list of grade items for users in a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param groupid: Get users from this group only
        :type groupid: int
        :param userid: Return grades only for this user (optional)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_user_get_grade_items_serialize(
            courseid=courseid,
            groupid=groupid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserGetGradeItemsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def gradereport_user_get_grade_items_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Get users from this group only")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Return grades only for this user (optional)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the complete list of grade items for users in a course

        Returns the complete list of grade items for users in a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param groupid: Get users from this group only
        :type groupid: int
        :param userid: Return grades only for this user (optional)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_user_get_grade_items_serialize(
            courseid=courseid,
            groupid=groupid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserGetGradeItemsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _gradereport_user_get_grade_items_serialize(
        self,
        courseid,
        groupid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#gradereport_user_get_grade_items'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'gradereport_user_get_grade_items'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'gradereport_user_get_grade_items',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def gradereport_user_get_grades_table_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Get users from this group only")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Return grades only for this user (optional)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the user/s report grades table for a course

        Get the user/s report grades table for a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param groupid: Get users from this group only
        :type groupid: int
        :param userid: Return grades only for this user (optional)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_user_get_grades_table_serialize(
            courseid=courseid,
            groupid=groupid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserGetGradesTableResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def gradereport_user_get_grades_table(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Get users from this group only")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Return grades only for this user (optional)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GradereportUserGetGradesTableResponse:
        """Get the user/s report grades table for a course

        Get the user/s report grades table for a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param groupid: Get users from this group only
        :type groupid: int
        :param userid: Return grades only for this user (optional)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_user_get_grades_table_serialize(
            courseid=courseid,
            groupid=groupid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserGetGradesTableResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradereport_user_get_grades_table_from_args(
        self,
        args
    ) -> GradereportUserGetGradesTableResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserGetGradesTableResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradereport_user_get_grades_table_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Get users from this group only")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Return grades only for this user (optional)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GradereportUserGetGradesTableResponse]:
        """Get the user/s report grades table for a course

        Get the user/s report grades table for a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param groupid: Get users from this group only
        :type groupid: int
        :param userid: Return grades only for this user (optional)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_user_get_grades_table_serialize(
            courseid=courseid,
            groupid=groupid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserGetGradesTableResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def gradereport_user_get_grades_table_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course Id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Get users from this group only")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Return grades only for this user (optional)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the user/s report grades table for a course

        Get the user/s report grades table for a course

        :param courseid: Course Id (required)
        :type courseid: int
        :param groupid: Get users from this group only
        :type groupid: int
        :param userid: Return grades only for this user (optional)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_user_get_grades_table_serialize(
            courseid=courseid,
            groupid=groupid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserGetGradesTableResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _gradereport_user_get_grades_table_serialize(
        self,
        courseid,
        groupid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#gradereport_user_get_grades_table'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'gradereport_user_get_grades_table'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'gradereport_user_get_grades_table',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def gradereport_user_view_grade_report_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course")],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 means current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the report view event

        Trigger the report view event

        :param courseid: id of the course (required)
        :type courseid: int
        :param userid: id of the user, 0 means current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_user_view_grade_report_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserViewGradeReportResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def gradereport_user_view_grade_report(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course")],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 means current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GradereportUserViewGradeReportResponse:
        """Trigger the report view event

        Trigger the report view event

        :param courseid: id of the course (required)
        :type courseid: int
        :param userid: id of the user, 0 means current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_user_view_grade_report_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserViewGradeReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradereport_user_view_grade_report_from_args(
        self,
        args
    ) -> GradereportUserViewGradeReportResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserViewGradeReportResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradereport_user_view_grade_report_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course")],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 means current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GradereportUserViewGradeReportResponse]:
        """Trigger the report view event

        Trigger the report view event

        :param courseid: id of the course (required)
        :type courseid: int
        :param userid: id of the user, 0 means current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_user_view_grade_report_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserViewGradeReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def gradereport_user_view_grade_report_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="id of the course")],
        userid: Annotated[Optional[StrictInt], Field(description="id of the user, 0 means current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the report view event

        Trigger the report view event

        :param courseid: id of the course (required)
        :type courseid: int
        :param userid: id of the user, 0 means current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradereport_user_view_grade_report_serialize(
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradereportUserViewGradeReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _gradereport_user_view_grade_report_serialize(
        self,
        courseid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#gradereport_user_view_grade_report'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'gradereport_user_view_grade_report'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'gradereport_user_view_grade_report',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def gradingform_guide_grader_gradingpanel_fetch_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetch the data required to display the grader grading panel, creating the grade item if required

        Fetch the data required to display the grader grading panel, creating the grade item if required

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradingform_guide_grader_gradingpanel_fetch_serialize(
            component=component,
            contextid=contextid,
            gradeduserid=gradeduserid,
            itemname=itemname,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformGuideGraderGradingpanelFetchResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def gradingform_guide_grader_gradingpanel_fetch(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GradingformGuideGraderGradingpanelFetchResponse:
        """Fetch the data required to display the grader grading panel, creating the grade item if required

        Fetch the data required to display the grader grading panel, creating the grade item if required

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradingform_guide_grader_gradingpanel_fetch_serialize(
            component=component,
            contextid=contextid,
            gradeduserid=gradeduserid,
            itemname=itemname,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformGuideGraderGradingpanelFetchResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradingform_guide_grader_gradingpanel_fetch_from_args(
        self,
        args
    ) -> GradingformGuideGraderGradingpanelFetchResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformGuideGraderGradingpanelFetchResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradingform_guide_grader_gradingpanel_fetch_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GradingformGuideGraderGradingpanelFetchResponse]:
        """Fetch the data required to display the grader grading panel, creating the grade item if required

        Fetch the data required to display the grader grading panel, creating the grade item if required

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradingform_guide_grader_gradingpanel_fetch_serialize(
            component=component,
            contextid=contextid,
            gradeduserid=gradeduserid,
            itemname=itemname,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformGuideGraderGradingpanelFetchResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def gradingform_guide_grader_gradingpanel_fetch_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetch the data required to display the grader grading panel, creating the grade item if required

        Fetch the data required to display the grader grading panel, creating the grade item if required

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradingform_guide_grader_gradingpanel_fetch_serialize(
            component=component,
            contextid=contextid,
            gradeduserid=gradeduserid,
            itemname=itemname,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformGuideGraderGradingpanelFetchResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _gradingform_guide_grader_gradingpanel_fetch_serialize(
        self,
        component,
        contextid,
        gradeduserid,
        itemname,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#gradingform_guide_grader_gradingpanel_fetch'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'gradingform_guide_grader_gradingpanel_fetch'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'gradingform_guide_grader_gradingpanel_fetch',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if component is not None:
            _form_params += parse_form({'component': component})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if gradeduserid is not None:
            _form_params += parse_form({'gradeduserid': gradeduserid})
        if itemname is not None:
            _form_params += parse_form({'itemname': itemname})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def gradingform_guide_grader_gradingpanel_store_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        formdata: Annotated[Optional[StrictStr], Field(description="The serialised form data representing the grade")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        notifyuser: Annotated[Optional[StrictBool], Field(description="Wheteher to notify the user or not")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Store the grading data for a user from the grader grading panel.

        Store the grading data for a user from the grader grading panel.

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param formdata: The serialised form data representing the grade (required)
        :type formdata: str
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param notifyuser: Wheteher to notify the user or not
        :type notifyuser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradingform_guide_grader_gradingpanel_store_serialize(
            component=component,
            contextid=contextid,
            formdata=formdata,
            gradeduserid=gradeduserid,
            itemname=itemname,
            notifyuser=notifyuser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformGuideGraderGradingpanelStoreResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def gradingform_guide_grader_gradingpanel_store(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        formdata: Annotated[Optional[StrictStr], Field(description="The serialised form data representing the grade")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        notifyuser: Annotated[Optional[StrictBool], Field(description="Wheteher to notify the user or not")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GradingformGuideGraderGradingpanelStoreResponse:
        """Store the grading data for a user from the grader grading panel.

        Store the grading data for a user from the grader grading panel.

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param formdata: The serialised form data representing the grade (required)
        :type formdata: str
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param notifyuser: Wheteher to notify the user or not
        :type notifyuser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradingform_guide_grader_gradingpanel_store_serialize(
            component=component,
            contextid=contextid,
            formdata=formdata,
            gradeduserid=gradeduserid,
            itemname=itemname,
            notifyuser=notifyuser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformGuideGraderGradingpanelStoreResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradingform_guide_grader_gradingpanel_store_from_args(
        self,
        args
    ) -> GradingformGuideGraderGradingpanelStoreResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformGuideGraderGradingpanelStoreResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradingform_guide_grader_gradingpanel_store_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        formdata: Annotated[Optional[StrictStr], Field(description="The serialised form data representing the grade")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        notifyuser: Annotated[Optional[StrictBool], Field(description="Wheteher to notify the user or not")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GradingformGuideGraderGradingpanelStoreResponse]:
        """Store the grading data for a user from the grader grading panel.

        Store the grading data for a user from the grader grading panel.

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param formdata: The serialised form data representing the grade (required)
        :type formdata: str
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param notifyuser: Wheteher to notify the user or not
        :type notifyuser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradingform_guide_grader_gradingpanel_store_serialize(
            component=component,
            contextid=contextid,
            formdata=formdata,
            gradeduserid=gradeduserid,
            itemname=itemname,
            notifyuser=notifyuser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformGuideGraderGradingpanelStoreResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def gradingform_guide_grader_gradingpanel_store_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        formdata: Annotated[Optional[StrictStr], Field(description="The serialised form data representing the grade")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        notifyuser: Annotated[Optional[StrictBool], Field(description="Wheteher to notify the user or not")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Store the grading data for a user from the grader grading panel.

        Store the grading data for a user from the grader grading panel.

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param formdata: The serialised form data representing the grade (required)
        :type formdata: str
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param notifyuser: Wheteher to notify the user or not
        :type notifyuser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradingform_guide_grader_gradingpanel_store_serialize(
            component=component,
            contextid=contextid,
            formdata=formdata,
            gradeduserid=gradeduserid,
            itemname=itemname,
            notifyuser=notifyuser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformGuideGraderGradingpanelStoreResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _gradingform_guide_grader_gradingpanel_store_serialize(
        self,
        component,
        contextid,
        formdata,
        gradeduserid,
        itemname,
        notifyuser,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#gradingform_guide_grader_gradingpanel_store'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'gradingform_guide_grader_gradingpanel_store'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'gradingform_guide_grader_gradingpanel_store',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if component is not None:
            _form_params += parse_form({'component': component})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if formdata is not None:
            _form_params += parse_form({'formdata': formdata})
        if gradeduserid is not None:
            _form_params += parse_form({'gradeduserid': gradeduserid})
        if itemname is not None:
            _form_params += parse_form({'itemname': itemname})
        if notifyuser is not None:
            _form_params += parse_form({'notifyuser': notifyuser})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def gradingform_rubric_grader_gradingpanel_fetch_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetch the data required to display the grader grading panel, creating the grade item if required

        Fetch the data required to display the grader grading panel, creating the grade item if required

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradingform_rubric_grader_gradingpanel_fetch_serialize(
            component=component,
            contextid=contextid,
            gradeduserid=gradeduserid,
            itemname=itemname,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformRubricGraderGradingpanelFetchResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def gradingform_rubric_grader_gradingpanel_fetch(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GradingformRubricGraderGradingpanelFetchResponse:
        """Fetch the data required to display the grader grading panel, creating the grade item if required

        Fetch the data required to display the grader grading panel, creating the grade item if required

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradingform_rubric_grader_gradingpanel_fetch_serialize(
            component=component,
            contextid=contextid,
            gradeduserid=gradeduserid,
            itemname=itemname,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformRubricGraderGradingpanelFetchResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradingform_rubric_grader_gradingpanel_fetch_from_args(
        self,
        args
    ) -> GradingformRubricGraderGradingpanelFetchResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformRubricGraderGradingpanelFetchResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradingform_rubric_grader_gradingpanel_fetch_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GradingformRubricGraderGradingpanelFetchResponse]:
        """Fetch the data required to display the grader grading panel, creating the grade item if required

        Fetch the data required to display the grader grading panel, creating the grade item if required

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradingform_rubric_grader_gradingpanel_fetch_serialize(
            component=component,
            contextid=contextid,
            gradeduserid=gradeduserid,
            itemname=itemname,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformRubricGraderGradingpanelFetchResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def gradingform_rubric_grader_gradingpanel_fetch_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetch the data required to display the grader grading panel, creating the grade item if required

        Fetch the data required to display the grader grading panel, creating the grade item if required

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradingform_rubric_grader_gradingpanel_fetch_serialize(
            component=component,
            contextid=contextid,
            gradeduserid=gradeduserid,
            itemname=itemname,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformRubricGraderGradingpanelFetchResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _gradingform_rubric_grader_gradingpanel_fetch_serialize(
        self,
        component,
        contextid,
        gradeduserid,
        itemname,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#gradingform_rubric_grader_gradingpanel_fetch'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'gradingform_rubric_grader_gradingpanel_fetch'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'gradingform_rubric_grader_gradingpanel_fetch',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if component is not None:
            _form_params += parse_form({'component': component})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if gradeduserid is not None:
            _form_params += parse_form({'gradeduserid': gradeduserid})
        if itemname is not None:
            _form_params += parse_form({'itemname': itemname})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def gradingform_rubric_grader_gradingpanel_store_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        formdata: Annotated[Optional[StrictStr], Field(description="The serialised form data representing the grade")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        notifyuser: Annotated[Optional[StrictBool], Field(description="Wheteher to notify the user or not")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Store the grading data for a user from the grader grading panel.

        Store the grading data for a user from the grader grading panel.

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param formdata: The serialised form data representing the grade (required)
        :type formdata: str
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param notifyuser: Wheteher to notify the user or not
        :type notifyuser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradingform_rubric_grader_gradingpanel_store_serialize(
            component=component,
            contextid=contextid,
            formdata=formdata,
            gradeduserid=gradeduserid,
            itemname=itemname,
            notifyuser=notifyuser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformRubricGraderGradingpanelStoreResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def gradingform_rubric_grader_gradingpanel_store(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        formdata: Annotated[Optional[StrictStr], Field(description="The serialised form data representing the grade")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        notifyuser: Annotated[Optional[StrictBool], Field(description="Wheteher to notify the user or not")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> GradingformRubricGraderGradingpanelStoreResponse:
        """Store the grading data for a user from the grader grading panel.

        Store the grading data for a user from the grader grading panel.

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param formdata: The serialised form data representing the grade (required)
        :type formdata: str
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param notifyuser: Wheteher to notify the user or not
        :type notifyuser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradingform_rubric_grader_gradingpanel_store_serialize(
            component=component,
            contextid=contextid,
            formdata=formdata,
            gradeduserid=gradeduserid,
            itemname=itemname,
            notifyuser=notifyuser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformRubricGraderGradingpanelStoreResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradingform_rubric_grader_gradingpanel_store_from_args(
        self,
        args
    ) -> GradingformRubricGraderGradingpanelStoreResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformRubricGraderGradingpanelStoreResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def gradingform_rubric_grader_gradingpanel_store_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        formdata: Annotated[Optional[StrictStr], Field(description="The serialised form data representing the grade")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        notifyuser: Annotated[Optional[StrictBool], Field(description="Wheteher to notify the user or not")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[GradingformRubricGraderGradingpanelStoreResponse]:
        """Store the grading data for a user from the grader grading panel.

        Store the grading data for a user from the grader grading panel.

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param formdata: The serialised form data representing the grade (required)
        :type formdata: str
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param notifyuser: Wheteher to notify the user or not
        :type notifyuser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradingform_rubric_grader_gradingpanel_store_serialize(
            component=component,
            contextid=contextid,
            formdata=formdata,
            gradeduserid=gradeduserid,
            itemname=itemname,
            notifyuser=notifyuser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformRubricGraderGradingpanelStoreResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def gradingform_rubric_grader_gradingpanel_store_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="The name of the component")],
        contextid: Annotated[Optional[StrictInt], Field(description="The ID of the context being graded")],
        formdata: Annotated[Optional[StrictStr], Field(description="The serialised form data representing the grade")],
        gradeduserid: Annotated[Optional[StrictInt], Field(description="The ID of the user show")],
        itemname: Annotated[Optional[StrictStr], Field(description="The grade item itemname being graded")],
        notifyuser: Annotated[Optional[StrictBool], Field(description="Wheteher to notify the user or not")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Store the grading data for a user from the grader grading panel.

        Store the grading data for a user from the grader grading panel.

        :param component: The name of the component (required)
        :type component: str
        :param contextid: The ID of the context being graded (required)
        :type contextid: int
        :param formdata: The serialised form data representing the grade (required)
        :type formdata: str
        :param gradeduserid: The ID of the user show (required)
        :type gradeduserid: int
        :param itemname: The grade item itemname being graded (required)
        :type itemname: str
        :param notifyuser: Wheteher to notify the user or not
        :type notifyuser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._gradingform_rubric_grader_gradingpanel_store_serialize(
            component=component,
            contextid=contextid,
            formdata=formdata,
            gradeduserid=gradeduserid,
            itemname=itemname,
            notifyuser=notifyuser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GradingformRubricGraderGradingpanelStoreResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _gradingform_rubric_grader_gradingpanel_store_serialize(
        self,
        component,
        contextid,
        formdata,
        gradeduserid,
        itemname,
        notifyuser,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#gradingform_rubric_grader_gradingpanel_store'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'gradingform_rubric_grader_gradingpanel_store'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'gradingform_rubric_grader_gradingpanel_store',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if component is not None:
            _form_params += parse_form({'component': component})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if formdata is not None:
            _form_params += parse_form({'formdata': formdata})
        if gradeduserid is not None:
            _form_params += parse_form({'gradeduserid': gradeduserid})
        if itemname is not None:
            _form_params += parse_form({'itemname': itemname})
        if notifyuser is not None:
            _form_params += parse_form({'notifyuser': notifyuser})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def login_token_args(
        self,
        password: StrictStr,
        service: StrictStr,
        username: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """login_token


        :param password: (required)
        :type password: str
        :param service: (required)
        :type service: str
        :param username: (required)
        :type username: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._login_token_serialize(
            password=password,
            service=service,
            username=username,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "LoginToken200Response",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def login_token(
        self,
        password: StrictStr,
        service: StrictStr,
        username: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> LoginToken200Response:
        """login_token


        :param password: (required)
        :type password: str
        :param service: (required)
        :type service: str
        :param username: (required)
        :type username: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._login_token_serialize(
            password=password,
            service=service,
            username=username,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "LoginToken200Response",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def login_token_from_args(
        self,
        args
    ) -> LoginToken200Response:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "LoginToken200Response",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def login_token_with_http_info(
        self,
        password: StrictStr,
        service: StrictStr,
        username: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[LoginToken200Response]:
        """login_token


        :param password: (required)
        :type password: str
        :param service: (required)
        :type service: str
        :param username: (required)
        :type username: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._login_token_serialize(
            password=password,
            service=service,
            username=username,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "LoginToken200Response",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def login_token_without_preload_content(
        self,
        password: StrictStr,
        service: StrictStr,
        username: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """login_token


        :param password: (required)
        :type password: str
        :param service: (required)
        :type service: str
        :param username: (required)
        :type username: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._login_token_serialize(
            password=password,
            service=service,
            username=username,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "LoginToken200Response",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _login_token_serialize(
        self,
        password,
        service,
        username,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/login/token.php'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'login_token'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'login_token',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if password is not None:
            _form_params += parse_form({'password': password})
        if service is not None:
            _form_params += parse_form({'service': service})
        if username is not None:
            _form_params += parse_form({'username': username})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def media_videojs_get_language_args(
        self,
        args: MediaVideojsGetLanguageParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """get language.

        get language.

        :param args: (required)
        :type args: MediaVideojsGetLanguageParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._media_videojs_get_language_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def media_videojs_get_language(
        self,
        args: MediaVideojsGetLanguageParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """get language.

        get language.

        :param args: (required)
        :type args: MediaVideojsGetLanguageParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._media_videojs_get_language_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def media_videojs_get_language_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def media_videojs_get_language_with_http_info(
        self,
        args: MediaVideojsGetLanguageParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """get language.

        get language.

        :param args: (required)
        :type args: MediaVideojsGetLanguageParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._media_videojs_get_language_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def media_videojs_get_language_without_preload_content(
        self,
        args: MediaVideojsGetLanguageParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """get language.

        get language.

        :param args: (required)
        :type args: MediaVideojsGetLanguageParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._media_videojs_get_language_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _media_videojs_get_language_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#media_videojs_get_language'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'media_videojs_get_language'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'media_videojs_get_language',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def message_airnotifier_are_notification_preferences_configured_args(
        self,
        userids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Check if the users have notification preferences configured yet

        Check if the users have notification preferences configured yet

        :param userids: (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_airnotifier_are_notification_preferences_configured_serialize(
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessageAirnotifierAreNotificationPreferencesConfiguredResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def message_airnotifier_are_notification_preferences_configured(
        self,
        userids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> MessageAirnotifierAreNotificationPreferencesConfiguredResponse:
        """Check if the users have notification preferences configured yet

        Check if the users have notification preferences configured yet

        :param userids: (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_airnotifier_are_notification_preferences_configured_serialize(
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessageAirnotifierAreNotificationPreferencesConfiguredResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def message_airnotifier_are_notification_preferences_configured_from_args(
        self,
        args
    ) -> MessageAirnotifierAreNotificationPreferencesConfiguredResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessageAirnotifierAreNotificationPreferencesConfiguredResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def message_airnotifier_are_notification_preferences_configured_with_http_info(
        self,
        userids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[MessageAirnotifierAreNotificationPreferencesConfiguredResponse]:
        """Check if the users have notification preferences configured yet

        Check if the users have notification preferences configured yet

        :param userids: (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_airnotifier_are_notification_preferences_configured_serialize(
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessageAirnotifierAreNotificationPreferencesConfiguredResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def message_airnotifier_are_notification_preferences_configured_without_preload_content(
        self,
        userids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Check if the users have notification preferences configured yet

        Check if the users have notification preferences configured yet

        :param userids: (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_airnotifier_are_notification_preferences_configured_serialize(
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessageAirnotifierAreNotificationPreferencesConfiguredResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _message_airnotifier_are_notification_preferences_configured_serialize(
        self,
        userids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'userids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#message_airnotifier_are_notification_preferences_configured'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'message_airnotifier_are_notification_preferences_configured'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'message_airnotifier_are_notification_preferences_configured',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userids is not None:
            _form_params += parse_form({'userids': userids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def message_airnotifier_enable_device_args(
        self,
        deviceid: Annotated[Optional[StrictInt], Field(description="The device id")],
        enable: Annotated[Optional[StrictBool], Field(description="True for enable the device, false otherwise")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Enables or disables a registered user device so it can receive Push notifications

        Enables or disables a registered user device so it can receive Push notifications

        :param deviceid: The device id (required)
        :type deviceid: int
        :param enable: True for enable the device, false otherwise (required)
        :type enable: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_airnotifier_enable_device_serialize(
            deviceid=deviceid,
            enable=enable,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessageAirnotifierEnableDeviceResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def message_airnotifier_enable_device(
        self,
        deviceid: Annotated[Optional[StrictInt], Field(description="The device id")],
        enable: Annotated[Optional[StrictBool], Field(description="True for enable the device, false otherwise")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> MessageAirnotifierEnableDeviceResponse:
        """Enables or disables a registered user device so it can receive Push notifications

        Enables or disables a registered user device so it can receive Push notifications

        :param deviceid: The device id (required)
        :type deviceid: int
        :param enable: True for enable the device, false otherwise (required)
        :type enable: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_airnotifier_enable_device_serialize(
            deviceid=deviceid,
            enable=enable,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessageAirnotifierEnableDeviceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def message_airnotifier_enable_device_from_args(
        self,
        args
    ) -> MessageAirnotifierEnableDeviceResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessageAirnotifierEnableDeviceResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def message_airnotifier_enable_device_with_http_info(
        self,
        deviceid: Annotated[Optional[StrictInt], Field(description="The device id")],
        enable: Annotated[Optional[StrictBool], Field(description="True for enable the device, false otherwise")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[MessageAirnotifierEnableDeviceResponse]:
        """Enables or disables a registered user device so it can receive Push notifications

        Enables or disables a registered user device so it can receive Push notifications

        :param deviceid: The device id (required)
        :type deviceid: int
        :param enable: True for enable the device, false otherwise (required)
        :type enable: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_airnotifier_enable_device_serialize(
            deviceid=deviceid,
            enable=enable,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessageAirnotifierEnableDeviceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def message_airnotifier_enable_device_without_preload_content(
        self,
        deviceid: Annotated[Optional[StrictInt], Field(description="The device id")],
        enable: Annotated[Optional[StrictBool], Field(description="True for enable the device, false otherwise")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Enables or disables a registered user device so it can receive Push notifications

        Enables or disables a registered user device so it can receive Push notifications

        :param deviceid: The device id (required)
        :type deviceid: int
        :param enable: True for enable the device, false otherwise (required)
        :type enable: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_airnotifier_enable_device_serialize(
            deviceid=deviceid,
            enable=enable,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessageAirnotifierEnableDeviceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _message_airnotifier_enable_device_serialize(
        self,
        deviceid,
        enable,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#message_airnotifier_enable_device'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'message_airnotifier_enable_device'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'message_airnotifier_enable_device',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if deviceid is not None:
            _form_params += parse_form({'deviceid': deviceid})
        if enable is not None:
            _form_params += parse_form({'enable': enable})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def message_airnotifier_get_user_devices_args(
        self,
        appid: Annotated[Optional[StrictStr], Field(description="App unique id (usually a reversed domain)")],
        userid: Annotated[Optional[StrictInt], Field(description="User id, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the list of mobile devices that are registered in Moodle for the given user

        Return the list of mobile devices that are registered in Moodle for the given user

        :param appid: App unique id (usually a reversed domain) (required)
        :type appid: str
        :param userid: User id, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_airnotifier_get_user_devices_serialize(
            appid=appid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessageAirnotifierGetUserDevicesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def message_airnotifier_get_user_devices(
        self,
        appid: Annotated[Optional[StrictStr], Field(description="App unique id (usually a reversed domain)")],
        userid: Annotated[Optional[StrictInt], Field(description="User id, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> MessageAirnotifierGetUserDevicesResponse:
        """Return the list of mobile devices that are registered in Moodle for the given user

        Return the list of mobile devices that are registered in Moodle for the given user

        :param appid: App unique id (usually a reversed domain) (required)
        :type appid: str
        :param userid: User id, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_airnotifier_get_user_devices_serialize(
            appid=appid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessageAirnotifierGetUserDevicesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def message_airnotifier_get_user_devices_from_args(
        self,
        args
    ) -> MessageAirnotifierGetUserDevicesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessageAirnotifierGetUserDevicesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def message_airnotifier_get_user_devices_with_http_info(
        self,
        appid: Annotated[Optional[StrictStr], Field(description="App unique id (usually a reversed domain)")],
        userid: Annotated[Optional[StrictInt], Field(description="User id, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[MessageAirnotifierGetUserDevicesResponse]:
        """Return the list of mobile devices that are registered in Moodle for the given user

        Return the list of mobile devices that are registered in Moodle for the given user

        :param appid: App unique id (usually a reversed domain) (required)
        :type appid: str
        :param userid: User id, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_airnotifier_get_user_devices_serialize(
            appid=appid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessageAirnotifierGetUserDevicesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def message_airnotifier_get_user_devices_without_preload_content(
        self,
        appid: Annotated[Optional[StrictStr], Field(description="App unique id (usually a reversed domain)")],
        userid: Annotated[Optional[StrictInt], Field(description="User id, 0 for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the list of mobile devices that are registered in Moodle for the given user

        Return the list of mobile devices that are registered in Moodle for the given user

        :param appid: App unique id (usually a reversed domain) (required)
        :type appid: str
        :param userid: User id, 0 for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_airnotifier_get_user_devices_serialize(
            appid=appid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessageAirnotifierGetUserDevicesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _message_airnotifier_get_user_devices_serialize(
        self,
        appid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#message_airnotifier_get_user_devices'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'message_airnotifier_get_user_devices'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'message_airnotifier_get_user_devices',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if appid is not None:
            _form_params += parse_form({'appid': appid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def message_airnotifier_is_system_configured_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Check whether the airnotifier settings have been configured

        Check whether the airnotifier settings have been configured

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_airnotifier_is_system_configured_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def message_airnotifier_is_system_configured(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> int:
        """Check whether the airnotifier settings have been configured

        Check whether the airnotifier settings have been configured

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_airnotifier_is_system_configured_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def message_airnotifier_is_system_configured_from_args(
        self,
        args
    ) -> int:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def message_airnotifier_is_system_configured_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[int]:
        """Check whether the airnotifier settings have been configured

        Check whether the airnotifier settings have been configured

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_airnotifier_is_system_configured_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def message_airnotifier_is_system_configured_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Check whether the airnotifier settings have been configured

        Check whether the airnotifier settings have been configured

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_airnotifier_is_system_configured_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _message_airnotifier_is_system_configured_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#message_airnotifier_is_system_configured'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'message_airnotifier_is_system_configured'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'message_airnotifier_is_system_configured',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def message_popup_get_popup_notifications_args(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for current user")],
        limit: Annotated[Optional[StrictInt], Field(description="the number of results to return")] = None,
        newestfirst: Annotated[Optional[StrictBool], Field(description="true for ordering by newest first, false for oldest first")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="offset the result set by a given amount")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve a list of popup notifications for a user

        Retrieve a list of popup notifications for a user

        :param useridto: the user id who received the message, 0 for current user (required)
        :type useridto: int
        :param limit: the number of results to return
        :type limit: int
        :param newestfirst: true for ordering by newest first, false for oldest first
        :type newestfirst: bool
        :param offset: offset the result set by a given amount
        :type offset: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_popup_get_popup_notifications_serialize(
            useridto=useridto,
            limit=limit,
            newestfirst=newestfirst,
            offset=offset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessagePopupGetPopupNotificationsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def message_popup_get_popup_notifications(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for current user")],
        limit: Annotated[Optional[StrictInt], Field(description="the number of results to return")] = None,
        newestfirst: Annotated[Optional[StrictBool], Field(description="true for ordering by newest first, false for oldest first")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="offset the result set by a given amount")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> MessagePopupGetPopupNotificationsResponse:
        """Retrieve a list of popup notifications for a user

        Retrieve a list of popup notifications for a user

        :param useridto: the user id who received the message, 0 for current user (required)
        :type useridto: int
        :param limit: the number of results to return
        :type limit: int
        :param newestfirst: true for ordering by newest first, false for oldest first
        :type newestfirst: bool
        :param offset: offset the result set by a given amount
        :type offset: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_popup_get_popup_notifications_serialize(
            useridto=useridto,
            limit=limit,
            newestfirst=newestfirst,
            offset=offset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessagePopupGetPopupNotificationsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def message_popup_get_popup_notifications_from_args(
        self,
        args
    ) -> MessagePopupGetPopupNotificationsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessagePopupGetPopupNotificationsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def message_popup_get_popup_notifications_with_http_info(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for current user")],
        limit: Annotated[Optional[StrictInt], Field(description="the number of results to return")] = None,
        newestfirst: Annotated[Optional[StrictBool], Field(description="true for ordering by newest first, false for oldest first")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="offset the result set by a given amount")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[MessagePopupGetPopupNotificationsResponse]:
        """Retrieve a list of popup notifications for a user

        Retrieve a list of popup notifications for a user

        :param useridto: the user id who received the message, 0 for current user (required)
        :type useridto: int
        :param limit: the number of results to return
        :type limit: int
        :param newestfirst: true for ordering by newest first, false for oldest first
        :type newestfirst: bool
        :param offset: offset the result set by a given amount
        :type offset: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_popup_get_popup_notifications_serialize(
            useridto=useridto,
            limit=limit,
            newestfirst=newestfirst,
            offset=offset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessagePopupGetPopupNotificationsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def message_popup_get_popup_notifications_without_preload_content(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for current user")],
        limit: Annotated[Optional[StrictInt], Field(description="the number of results to return")] = None,
        newestfirst: Annotated[Optional[StrictBool], Field(description="true for ordering by newest first, false for oldest first")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="offset the result set by a given amount")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve a list of popup notifications for a user

        Retrieve a list of popup notifications for a user

        :param useridto: the user id who received the message, 0 for current user (required)
        :type useridto: int
        :param limit: the number of results to return
        :type limit: int
        :param newestfirst: true for ordering by newest first, false for oldest first
        :type newestfirst: bool
        :param offset: offset the result set by a given amount
        :type offset: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_popup_get_popup_notifications_serialize(
            useridto=useridto,
            limit=limit,
            newestfirst=newestfirst,
            offset=offset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "MessagePopupGetPopupNotificationsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _message_popup_get_popup_notifications_serialize(
        self,
        useridto,
        limit,
        newestfirst,
        offset,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#message_popup_get_popup_notifications'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'message_popup_get_popup_notifications'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'message_popup_get_popup_notifications',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if newestfirst is not None:
            _form_params += parse_form({'newestfirst': newestfirst})
        if offset is not None:
            _form_params += parse_form({'offset': offset})
        if useridto is not None:
            _form_params += parse_form({'useridto': useridto})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def message_popup_get_unread_popup_notification_count_args(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for any user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve the count of unread popup notifications for a given user

        Retrieve the count of unread popup notifications for a given user

        :param useridto: the user id who received the message, 0 for any user (required)
        :type useridto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_popup_get_unread_popup_notification_count_serialize(
            useridto=useridto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def message_popup_get_unread_popup_notification_count(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for any user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> int:
        """Retrieve the count of unread popup notifications for a given user

        Retrieve the count of unread popup notifications for a given user

        :param useridto: the user id who received the message, 0 for any user (required)
        :type useridto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_popup_get_unread_popup_notification_count_serialize(
            useridto=useridto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def message_popup_get_unread_popup_notification_count_from_args(
        self,
        args
    ) -> int:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def message_popup_get_unread_popup_notification_count_with_http_info(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for any user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[int]:
        """Retrieve the count of unread popup notifications for a given user

        Retrieve the count of unread popup notifications for a given user

        :param useridto: the user id who received the message, 0 for any user (required)
        :type useridto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_popup_get_unread_popup_notification_count_serialize(
            useridto=useridto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def message_popup_get_unread_popup_notification_count_without_preload_content(
        self,
        useridto: Annotated[Optional[StrictInt], Field(description="the user id who received the message, 0 for any user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve the count of unread popup notifications for a given user

        Retrieve the count of unread popup notifications for a given user

        :param useridto: the user id who received the message, 0 for any user (required)
        :type useridto: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._message_popup_get_unread_popup_notification_count_serialize(
            useridto=useridto,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "int",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _message_popup_get_unread_popup_notification_count_serialize(
        self,
        useridto,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#message_popup_get_unread_popup_notification_count'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'message_popup_get_unread_popup_notification_count'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'message_popup_get_unread_popup_notification_count',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if useridto is not None:
            _form_params += parse_form({'useridto': useridto})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_copy_previous_attempt_args(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Copy a students previous attempt to a new attempt.

        Copy a students previous attempt to a new attempt.

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_copy_previous_attempt_serialize(
            assignmentid=assignmentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_copy_previous_attempt(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Copy a students previous attempt to a new attempt.

        Copy a students previous attempt to a new attempt.

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_copy_previous_attempt_serialize(
            assignmentid=assignmentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_copy_previous_attempt_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_copy_previous_attempt_with_http_info(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Copy a students previous attempt to a new attempt.

        Copy a students previous attempt to a new attempt.

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_copy_previous_attempt_serialize(
            assignmentid=assignmentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_copy_previous_attempt_without_preload_content(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Copy a students previous attempt to a new attempt.

        Copy a students previous attempt to a new attempt.

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_copy_previous_attempt_serialize(
            assignmentid=assignmentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_copy_previous_attempt_serialize(
        self,
        assignmentid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_copy_previous_attempt'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_copy_previous_attempt'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_copy_previous_attempt',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignmentid is not None:
            _form_params += parse_form({'assignmentid': assignmentid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_get_assignments_args(
        self,
        capabilities: Annotated[Optional[List[Optional[StrictStr]]], Field(description="list of capabilities used to filter courses")] = None,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="0 or more course ids")] = None,
        includenotenrolledcourses: Annotated[Optional[StrictBool], Field(description="whether to return courses that the user can see                                                                     even if is not enroled in. This requires the parameter courseids                                                                     to not be empty.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the courses and assignments for the users capability

        Returns the courses and assignments for the users capability

        :param capabilities: list of capabilities used to filter courses
        :type capabilities: List[Optional[str]]
        :param courseids: 0 or more course ids
        :type courseids: List[Optional[int]]
        :param includenotenrolledcourses: whether to return courses that the user can see                                                                     even if is not enroled in. This requires the parameter courseids                                                                     to not be empty.
        :type includenotenrolledcourses: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_assignments_serialize(
            capabilities=capabilities,
            courseids=courseids,
            includenotenrolledcourses=includenotenrolledcourses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetAssignmentsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_get_assignments(
        self,
        capabilities: Annotated[Optional[List[Optional[StrictStr]]], Field(description="list of capabilities used to filter courses")] = None,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="0 or more course ids")] = None,
        includenotenrolledcourses: Annotated[Optional[StrictBool], Field(description="whether to return courses that the user can see                                                                     even if is not enroled in. This requires the parameter courseids                                                                     to not be empty.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModAssignGetAssignmentsResponse:
        """Returns the courses and assignments for the users capability

        Returns the courses and assignments for the users capability

        :param capabilities: list of capabilities used to filter courses
        :type capabilities: List[Optional[str]]
        :param courseids: 0 or more course ids
        :type courseids: List[Optional[int]]
        :param includenotenrolledcourses: whether to return courses that the user can see                                                                     even if is not enroled in. This requires the parameter courseids                                                                     to not be empty.
        :type includenotenrolledcourses: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_assignments_serialize(
            capabilities=capabilities,
            courseids=courseids,
            includenotenrolledcourses=includenotenrolledcourses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetAssignmentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_get_assignments_from_args(
        self,
        args
    ) -> ModAssignGetAssignmentsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetAssignmentsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_get_assignments_with_http_info(
        self,
        capabilities: Annotated[Optional[List[Optional[StrictStr]]], Field(description="list of capabilities used to filter courses")] = None,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="0 or more course ids")] = None,
        includenotenrolledcourses: Annotated[Optional[StrictBool], Field(description="whether to return courses that the user can see                                                                     even if is not enroled in. This requires the parameter courseids                                                                     to not be empty.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModAssignGetAssignmentsResponse]:
        """Returns the courses and assignments for the users capability

        Returns the courses and assignments for the users capability

        :param capabilities: list of capabilities used to filter courses
        :type capabilities: List[Optional[str]]
        :param courseids: 0 or more course ids
        :type courseids: List[Optional[int]]
        :param includenotenrolledcourses: whether to return courses that the user can see                                                                     even if is not enroled in. This requires the parameter courseids                                                                     to not be empty.
        :type includenotenrolledcourses: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_assignments_serialize(
            capabilities=capabilities,
            courseids=courseids,
            includenotenrolledcourses=includenotenrolledcourses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetAssignmentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_get_assignments_without_preload_content(
        self,
        capabilities: Annotated[Optional[List[Optional[StrictStr]]], Field(description="list of capabilities used to filter courses")] = None,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="0 or more course ids")] = None,
        includenotenrolledcourses: Annotated[Optional[StrictBool], Field(description="whether to return courses that the user can see                                                                     even if is not enroled in. This requires the parameter courseids                                                                     to not be empty.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the courses and assignments for the users capability

        Returns the courses and assignments for the users capability

        :param capabilities: list of capabilities used to filter courses
        :type capabilities: List[Optional[str]]
        :param courseids: 0 or more course ids
        :type courseids: List[Optional[int]]
        :param includenotenrolledcourses: whether to return courses that the user can see                                                                     even if is not enroled in. This requires the parameter courseids                                                                     to not be empty.
        :type includenotenrolledcourses: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_assignments_serialize(
            capabilities=capabilities,
            courseids=courseids,
            includenotenrolledcourses=includenotenrolledcourses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetAssignmentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_get_assignments_serialize(
        self,
        capabilities,
        courseids,
        includenotenrolledcourses,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'capabilities': 'csv',
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_get_assignments'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_get_assignments'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_get_assignments',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if capabilities is not None:
            _form_params += parse_form({'capabilities': capabilities})
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        if includenotenrolledcourses is not None:
            _form_params += parse_form({'includenotenrolledcourses': includenotenrolledcourses})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_get_grades_args(
        self,
        assignmentids: Annotated[List[Optional[StrictInt]], Field(description="1 or more assignment ids")],
        since: Annotated[Optional[StrictInt], Field(description="timestamp, only return records where timemodified >= since")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns grades from the assignment

        Returns grades from the assignment

        :param assignmentids: 1 or more assignment ids (required)
        :type assignmentids: List[Optional[int]]
        :param since: timestamp, only return records where timemodified >= since
        :type since: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_grades_serialize(
            assignmentids=assignmentids,
            since=since,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetGradesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_get_grades(
        self,
        assignmentids: Annotated[List[Optional[StrictInt]], Field(description="1 or more assignment ids")],
        since: Annotated[Optional[StrictInt], Field(description="timestamp, only return records where timemodified >= since")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModAssignGetGradesResponse:
        """Returns grades from the assignment

        Returns grades from the assignment

        :param assignmentids: 1 or more assignment ids (required)
        :type assignmentids: List[Optional[int]]
        :param since: timestamp, only return records where timemodified >= since
        :type since: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_grades_serialize(
            assignmentids=assignmentids,
            since=since,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetGradesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_get_grades_from_args(
        self,
        args
    ) -> ModAssignGetGradesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetGradesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_get_grades_with_http_info(
        self,
        assignmentids: Annotated[List[Optional[StrictInt]], Field(description="1 or more assignment ids")],
        since: Annotated[Optional[StrictInt], Field(description="timestamp, only return records where timemodified >= since")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModAssignGetGradesResponse]:
        """Returns grades from the assignment

        Returns grades from the assignment

        :param assignmentids: 1 or more assignment ids (required)
        :type assignmentids: List[Optional[int]]
        :param since: timestamp, only return records where timemodified >= since
        :type since: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_grades_serialize(
            assignmentids=assignmentids,
            since=since,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetGradesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_get_grades_without_preload_content(
        self,
        assignmentids: Annotated[List[Optional[StrictInt]], Field(description="1 or more assignment ids")],
        since: Annotated[Optional[StrictInt], Field(description="timestamp, only return records where timemodified >= since")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns grades from the assignment

        Returns grades from the assignment

        :param assignmentids: 1 or more assignment ids (required)
        :type assignmentids: List[Optional[int]]
        :param since: timestamp, only return records where timemodified >= since
        :type since: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_grades_serialize(
            assignmentids=assignmentids,
            since=since,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetGradesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_get_grades_serialize(
        self,
        assignmentids,
        since,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'assignmentids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_get_grades'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_get_grades'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_get_grades',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignmentids is not None:
            _form_params += parse_form({'assignmentids': assignmentids})
        if since is not None:
            _form_params += parse_form({'since': since})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_get_participant_args(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")],
        embeduser: Annotated[Optional[StrictBool], Field(description="user id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get a participant for an assignment, with some summary info about their submissions.

        Get a participant for an assignment, with some summary info about their submissions.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param userid: user id (required)
        :type userid: int
        :param embeduser: user id
        :type embeduser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_participant_serialize(
            assignid=assignid,
            userid=userid,
            embeduser=embeduser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetParticipantResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_get_participant(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")],
        embeduser: Annotated[Optional[StrictBool], Field(description="user id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModAssignGetParticipantResponse:
        """Get a participant for an assignment, with some summary info about their submissions.

        Get a participant for an assignment, with some summary info about their submissions.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param userid: user id (required)
        :type userid: int
        :param embeduser: user id
        :type embeduser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_participant_serialize(
            assignid=assignid,
            userid=userid,
            embeduser=embeduser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetParticipantResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_get_participant_from_args(
        self,
        args
    ) -> ModAssignGetParticipantResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetParticipantResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_get_participant_with_http_info(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")],
        embeduser: Annotated[Optional[StrictBool], Field(description="user id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModAssignGetParticipantResponse]:
        """Get a participant for an assignment, with some summary info about their submissions.

        Get a participant for an assignment, with some summary info about their submissions.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param userid: user id (required)
        :type userid: int
        :param embeduser: user id
        :type embeduser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_participant_serialize(
            assignid=assignid,
            userid=userid,
            embeduser=embeduser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetParticipantResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_get_participant_without_preload_content(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")],
        embeduser: Annotated[Optional[StrictBool], Field(description="user id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get a participant for an assignment, with some summary info about their submissions.

        Get a participant for an assignment, with some summary info about their submissions.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param userid: user id (required)
        :type userid: int
        :param embeduser: user id
        :type embeduser: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_participant_serialize(
            assignid=assignid,
            userid=userid,
            embeduser=embeduser,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetParticipantResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_get_participant_serialize(
        self,
        assignid,
        userid,
        embeduser,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_get_participant'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_get_participant'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_get_participant',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignid is not None:
            _form_params += parse_form({'assignid': assignid})
        if embeduser is not None:
            _form_params += parse_form({'embeduser': embeduser})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_get_submission_status_args(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assignment instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="filter by users in group (used for generating the grading summary).                     0 for all groups information, any other empty value will calculate currrent group.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns information about an assignment submission status for a given user.

        Returns information about an assignment submission status for a given user.

        :param assignid: assignment instance id (required)
        :type assignid: int
        :param groupid: filter by users in group (used for generating the grading summary).                     0 for all groups information, any other empty value will calculate currrent group.
        :type groupid: int
        :param userid: user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_submission_status_serialize(
            assignid=assignid,
            groupid=groupid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetSubmissionStatusResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_get_submission_status(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assignment instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="filter by users in group (used for generating the grading summary).                     0 for all groups information, any other empty value will calculate currrent group.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModAssignGetSubmissionStatusResponse:
        """Returns information about an assignment submission status for a given user.

        Returns information about an assignment submission status for a given user.

        :param assignid: assignment instance id (required)
        :type assignid: int
        :param groupid: filter by users in group (used for generating the grading summary).                     0 for all groups information, any other empty value will calculate currrent group.
        :type groupid: int
        :param userid: user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_submission_status_serialize(
            assignid=assignid,
            groupid=groupid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetSubmissionStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_get_submission_status_from_args(
        self,
        args
    ) -> ModAssignGetSubmissionStatusResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetSubmissionStatusResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_get_submission_status_with_http_info(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assignment instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="filter by users in group (used for generating the grading summary).                     0 for all groups information, any other empty value will calculate currrent group.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModAssignGetSubmissionStatusResponse]:
        """Returns information about an assignment submission status for a given user.

        Returns information about an assignment submission status for a given user.

        :param assignid: assignment instance id (required)
        :type assignid: int
        :param groupid: filter by users in group (used for generating the grading summary).                     0 for all groups information, any other empty value will calculate currrent group.
        :type groupid: int
        :param userid: user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_submission_status_serialize(
            assignid=assignid,
            groupid=groupid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetSubmissionStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_get_submission_status_without_preload_content(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assignment instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="filter by users in group (used for generating the grading summary).                     0 for all groups information, any other empty value will calculate currrent group.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns information about an assignment submission status for a given user.

        Returns information about an assignment submission status for a given user.

        :param assignid: assignment instance id (required)
        :type assignid: int
        :param groupid: filter by users in group (used for generating the grading summary).                     0 for all groups information, any other empty value will calculate currrent group.
        :type groupid: int
        :param userid: user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_submission_status_serialize(
            assignid=assignid,
            groupid=groupid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetSubmissionStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_get_submission_status_serialize(
        self,
        assignid,
        groupid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_get_submission_status'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_get_submission_status'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_get_submission_status',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignid is not None:
            _form_params += parse_form({'assignid': assignid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_get_submissions_args(
        self,
        assignmentids: Annotated[List[Optional[StrictInt]], Field(description="1 or more assignment ids")],
        before: Annotated[Optional[StrictInt], Field(description="submitted before")] = None,
        since: Annotated[Optional[StrictInt], Field(description="submitted since")] = None,
        status: Annotated[Optional[StrictStr], Field(description="status")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the submissions for assignments

        Returns the submissions for assignments

        :param assignmentids: 1 or more assignment ids (required)
        :type assignmentids: List[Optional[int]]
        :param before: submitted before
        :type before: int
        :param since: submitted since
        :type since: int
        :param status: status
        :type status: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_submissions_serialize(
            assignmentids=assignmentids,
            before=before,
            since=since,
            status=status,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetSubmissionsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_get_submissions(
        self,
        assignmentids: Annotated[List[Optional[StrictInt]], Field(description="1 or more assignment ids")],
        before: Annotated[Optional[StrictInt], Field(description="submitted before")] = None,
        since: Annotated[Optional[StrictInt], Field(description="submitted since")] = None,
        status: Annotated[Optional[StrictStr], Field(description="status")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModAssignGetSubmissionsResponse:
        """Returns the submissions for assignments

        Returns the submissions for assignments

        :param assignmentids: 1 or more assignment ids (required)
        :type assignmentids: List[Optional[int]]
        :param before: submitted before
        :type before: int
        :param since: submitted since
        :type since: int
        :param status: status
        :type status: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_submissions_serialize(
            assignmentids=assignmentids,
            before=before,
            since=since,
            status=status,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetSubmissionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_get_submissions_from_args(
        self,
        args
    ) -> ModAssignGetSubmissionsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetSubmissionsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_get_submissions_with_http_info(
        self,
        assignmentids: Annotated[List[Optional[StrictInt]], Field(description="1 or more assignment ids")],
        before: Annotated[Optional[StrictInt], Field(description="submitted before")] = None,
        since: Annotated[Optional[StrictInt], Field(description="submitted since")] = None,
        status: Annotated[Optional[StrictStr], Field(description="status")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModAssignGetSubmissionsResponse]:
        """Returns the submissions for assignments

        Returns the submissions for assignments

        :param assignmentids: 1 or more assignment ids (required)
        :type assignmentids: List[Optional[int]]
        :param before: submitted before
        :type before: int
        :param since: submitted since
        :type since: int
        :param status: status
        :type status: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_submissions_serialize(
            assignmentids=assignmentids,
            before=before,
            since=since,
            status=status,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetSubmissionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_get_submissions_without_preload_content(
        self,
        assignmentids: Annotated[List[Optional[StrictInt]], Field(description="1 or more assignment ids")],
        before: Annotated[Optional[StrictInt], Field(description="submitted before")] = None,
        since: Annotated[Optional[StrictInt], Field(description="submitted since")] = None,
        status: Annotated[Optional[StrictStr], Field(description="status")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the submissions for assignments

        Returns the submissions for assignments

        :param assignmentids: 1 or more assignment ids (required)
        :type assignmentids: List[Optional[int]]
        :param before: submitted before
        :type before: int
        :param since: submitted since
        :type since: int
        :param status: status
        :type status: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_submissions_serialize(
            assignmentids=assignmentids,
            before=before,
            since=since,
            status=status,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetSubmissionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_get_submissions_serialize(
        self,
        assignmentids,
        before,
        since,
        status,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'assignmentids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_get_submissions'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_get_submissions'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_get_submissions',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignmentids is not None:
            _form_params += parse_form({'assignmentids': assignmentids})
        if before is not None:
            _form_params += parse_form({'before': before})
        if since is not None:
            _form_params += parse_form({'since': since})
        if status is not None:
            _form_params += parse_form({'status': status})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_get_user_flags_args(
        self,
        assignmentids: Annotated[List[Optional[StrictInt]], Field(description="1 or more assignment ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the user flags for assignments

        Returns the user flags for assignments

        :param assignmentids: 1 or more assignment ids (required)
        :type assignmentids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_user_flags_serialize(
            assignmentids=assignmentids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetUserFlagsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_get_user_flags(
        self,
        assignmentids: Annotated[List[Optional[StrictInt]], Field(description="1 or more assignment ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModAssignGetUserFlagsResponse:
        """Returns the user flags for assignments

        Returns the user flags for assignments

        :param assignmentids: 1 or more assignment ids (required)
        :type assignmentids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_user_flags_serialize(
            assignmentids=assignmentids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetUserFlagsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_get_user_flags_from_args(
        self,
        args
    ) -> ModAssignGetUserFlagsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetUserFlagsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_get_user_flags_with_http_info(
        self,
        assignmentids: Annotated[List[Optional[StrictInt]], Field(description="1 or more assignment ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModAssignGetUserFlagsResponse]:
        """Returns the user flags for assignments

        Returns the user flags for assignments

        :param assignmentids: 1 or more assignment ids (required)
        :type assignmentids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_user_flags_serialize(
            assignmentids=assignmentids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetUserFlagsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_get_user_flags_without_preload_content(
        self,
        assignmentids: Annotated[List[Optional[StrictInt]], Field(description="1 or more assignment ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the user flags for assignments

        Returns the user flags for assignments

        :param assignmentids: 1 or more assignment ids (required)
        :type assignmentids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_user_flags_serialize(
            assignmentids=assignmentids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetUserFlagsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_get_user_flags_serialize(
        self,
        assignmentids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'assignmentids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_get_user_flags'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_get_user_flags'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_get_user_flags',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignmentids is not None:
            _form_params += parse_form({'assignmentids': assignmentids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_get_user_mappings_args(
        self,
        assignmentids: Annotated[List[Optional[StrictInt]], Field(description="1 or more assignment ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the blind marking mappings for assignments

        Returns the blind marking mappings for assignments

        :param assignmentids: 1 or more assignment ids (required)
        :type assignmentids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_user_mappings_serialize(
            assignmentids=assignmentids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetUserMappingsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_get_user_mappings(
        self,
        assignmentids: Annotated[List[Optional[StrictInt]], Field(description="1 or more assignment ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModAssignGetUserMappingsResponse:
        """Returns the blind marking mappings for assignments

        Returns the blind marking mappings for assignments

        :param assignmentids: 1 or more assignment ids (required)
        :type assignmentids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_user_mappings_serialize(
            assignmentids=assignmentids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetUserMappingsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_get_user_mappings_from_args(
        self,
        args
    ) -> ModAssignGetUserMappingsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetUserMappingsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_get_user_mappings_with_http_info(
        self,
        assignmentids: Annotated[List[Optional[StrictInt]], Field(description="1 or more assignment ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModAssignGetUserMappingsResponse]:
        """Returns the blind marking mappings for assignments

        Returns the blind marking mappings for assignments

        :param assignmentids: 1 or more assignment ids (required)
        :type assignmentids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_user_mappings_serialize(
            assignmentids=assignmentids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetUserMappingsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_get_user_mappings_without_preload_content(
        self,
        assignmentids: Annotated[List[Optional[StrictInt]], Field(description="1 or more assignment ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the blind marking mappings for assignments

        Returns the blind marking mappings for assignments

        :param assignmentids: 1 or more assignment ids (required)
        :type assignmentids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_get_user_mappings_serialize(
            assignmentids=assignmentids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignGetUserMappingsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_get_user_mappings_serialize(
        self,
        assignmentids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'assignmentids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_get_user_mappings'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_get_user_mappings'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_get_user_mappings',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignmentids is not None:
            _form_params += parse_form({'assignmentids': assignmentids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_list_participants_args(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        filter: Annotated[Optional[StrictStr], Field(description="search string to filter the results")],
        groupid: Annotated[Optional[StrictInt], Field(description="group id")],
        includeenrolments: Annotated[Optional[StrictBool], Field(description="Do return courses where the user is enrolled")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="maximum number of records to return")] = None,
        onlyids: Annotated[Optional[StrictBool], Field(description="Do not return all user fields")] = None,
        skip: Annotated[Optional[StrictInt], Field(description="number of records to skip")] = None,
        tablesort: Annotated[Optional[StrictBool], Field(description="Apply current user table sorting preferences.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """List the participants for a single assignment, with some summary info about their submissions.

        List the participants for a single assignment, with some summary info about their submissions.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param filter: search string to filter the results (required)
        :type filter: str
        :param groupid: group id (required)
        :type groupid: int
        :param includeenrolments: Do return courses where the user is enrolled
        :type includeenrolments: bool
        :param limit: maximum number of records to return
        :type limit: int
        :param onlyids: Do not return all user fields
        :type onlyids: bool
        :param skip: number of records to skip
        :type skip: int
        :param tablesort: Apply current user table sorting preferences.
        :type tablesort: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_list_participants_serialize(
            assignid=assignid,
            filter=filter,
            groupid=groupid,
            includeenrolments=includeenrolments,
            limit=limit,
            onlyids=onlyids,
            skip=skip,
            tablesort=tablesort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModAssignListParticipantsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_list_participants(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        filter: Annotated[Optional[StrictStr], Field(description="search string to filter the results")],
        groupid: Annotated[Optional[StrictInt], Field(description="group id")],
        includeenrolments: Annotated[Optional[StrictBool], Field(description="Do return courses where the user is enrolled")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="maximum number of records to return")] = None,
        onlyids: Annotated[Optional[StrictBool], Field(description="Do not return all user fields")] = None,
        skip: Annotated[Optional[StrictInt], Field(description="number of records to skip")] = None,
        tablesort: Annotated[Optional[StrictBool], Field(description="Apply current user table sorting preferences.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[ModAssignListParticipantsResponseInner]:
        """List the participants for a single assignment, with some summary info about their submissions.

        List the participants for a single assignment, with some summary info about their submissions.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param filter: search string to filter the results (required)
        :type filter: str
        :param groupid: group id (required)
        :type groupid: int
        :param includeenrolments: Do return courses where the user is enrolled
        :type includeenrolments: bool
        :param limit: maximum number of records to return
        :type limit: int
        :param onlyids: Do not return all user fields
        :type onlyids: bool
        :param skip: number of records to skip
        :type skip: int
        :param tablesort: Apply current user table sorting preferences.
        :type tablesort: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_list_participants_serialize(
            assignid=assignid,
            filter=filter,
            groupid=groupid,
            includeenrolments=includeenrolments,
            limit=limit,
            onlyids=onlyids,
            skip=skip,
            tablesort=tablesort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModAssignListParticipantsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_list_participants_from_args(
        self,
        args
    ) -> List[ModAssignListParticipantsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModAssignListParticipantsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_list_participants_with_http_info(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        filter: Annotated[Optional[StrictStr], Field(description="search string to filter the results")],
        groupid: Annotated[Optional[StrictInt], Field(description="group id")],
        includeenrolments: Annotated[Optional[StrictBool], Field(description="Do return courses where the user is enrolled")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="maximum number of records to return")] = None,
        onlyids: Annotated[Optional[StrictBool], Field(description="Do not return all user fields")] = None,
        skip: Annotated[Optional[StrictInt], Field(description="number of records to skip")] = None,
        tablesort: Annotated[Optional[StrictBool], Field(description="Apply current user table sorting preferences.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[ModAssignListParticipantsResponseInner]]:
        """List the participants for a single assignment, with some summary info about their submissions.

        List the participants for a single assignment, with some summary info about their submissions.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param filter: search string to filter the results (required)
        :type filter: str
        :param groupid: group id (required)
        :type groupid: int
        :param includeenrolments: Do return courses where the user is enrolled
        :type includeenrolments: bool
        :param limit: maximum number of records to return
        :type limit: int
        :param onlyids: Do not return all user fields
        :type onlyids: bool
        :param skip: number of records to skip
        :type skip: int
        :param tablesort: Apply current user table sorting preferences.
        :type tablesort: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_list_participants_serialize(
            assignid=assignid,
            filter=filter,
            groupid=groupid,
            includeenrolments=includeenrolments,
            limit=limit,
            onlyids=onlyids,
            skip=skip,
            tablesort=tablesort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModAssignListParticipantsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_list_participants_without_preload_content(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        filter: Annotated[Optional[StrictStr], Field(description="search string to filter the results")],
        groupid: Annotated[Optional[StrictInt], Field(description="group id")],
        includeenrolments: Annotated[Optional[StrictBool], Field(description="Do return courses where the user is enrolled")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="maximum number of records to return")] = None,
        onlyids: Annotated[Optional[StrictBool], Field(description="Do not return all user fields")] = None,
        skip: Annotated[Optional[StrictInt], Field(description="number of records to skip")] = None,
        tablesort: Annotated[Optional[StrictBool], Field(description="Apply current user table sorting preferences.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List the participants for a single assignment, with some summary info about their submissions.

        List the participants for a single assignment, with some summary info about their submissions.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param filter: search string to filter the results (required)
        :type filter: str
        :param groupid: group id (required)
        :type groupid: int
        :param includeenrolments: Do return courses where the user is enrolled
        :type includeenrolments: bool
        :param limit: maximum number of records to return
        :type limit: int
        :param onlyids: Do not return all user fields
        :type onlyids: bool
        :param skip: number of records to skip
        :type skip: int
        :param tablesort: Apply current user table sorting preferences.
        :type tablesort: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_list_participants_serialize(
            assignid=assignid,
            filter=filter,
            groupid=groupid,
            includeenrolments=includeenrolments,
            limit=limit,
            onlyids=onlyids,
            skip=skip,
            tablesort=tablesort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModAssignListParticipantsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_list_participants_serialize(
        self,
        assignid,
        filter,
        groupid,
        includeenrolments,
        limit,
        onlyids,
        skip,
        tablesort,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_list_participants'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_list_participants'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_list_participants',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignid is not None:
            _form_params += parse_form({'assignid': assignid})
        if filter is not None:
            _form_params += parse_form({'filter': filter})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if includeenrolments is not None:
            _form_params += parse_form({'includeenrolments': includeenrolments})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if onlyids is not None:
            _form_params += parse_form({'onlyids': onlyids})
        if skip is not None:
            _form_params += parse_form({'skip': skip})
        if tablesort is not None:
            _form_params += parse_form({'tablesort': tablesort})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_lock_submissions_args(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        userids: Annotated[List[Optional[StrictInt]], Field(description="1 or more user ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Prevent students from making changes to a list of submissions

        Prevent students from making changes to a list of submissions

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param userids: 1 or more user ids (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_lock_submissions_serialize(
            assignmentid=assignmentid,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_lock_submissions(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        userids: Annotated[List[Optional[StrictInt]], Field(description="1 or more user ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Prevent students from making changes to a list of submissions

        Prevent students from making changes to a list of submissions

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param userids: 1 or more user ids (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_lock_submissions_serialize(
            assignmentid=assignmentid,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_lock_submissions_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_lock_submissions_with_http_info(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        userids: Annotated[List[Optional[StrictInt]], Field(description="1 or more user ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Prevent students from making changes to a list of submissions

        Prevent students from making changes to a list of submissions

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param userids: 1 or more user ids (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_lock_submissions_serialize(
            assignmentid=assignmentid,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_lock_submissions_without_preload_content(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        userids: Annotated[List[Optional[StrictInt]], Field(description="1 or more user ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Prevent students from making changes to a list of submissions

        Prevent students from making changes to a list of submissions

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param userids: 1 or more user ids (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_lock_submissions_serialize(
            assignmentid=assignmentid,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_lock_submissions_serialize(
        self,
        assignmentid,
        userids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'userids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_lock_submissions'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_lock_submissions'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_lock_submissions',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignmentid is not None:
            _form_params += parse_form({'assignmentid': assignmentid})
        if userids is not None:
            _form_params += parse_form({'userids': userids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_remove_submission_args(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="Assignment instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="User id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Remove submission.

        Remove submission.

        :param assignid: Assignment instance id (required)
        :type assignid: int
        :param userid: User id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_remove_submission_serialize(
            assignid=assignid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignRemoveSubmissionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_remove_submission(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="Assignment instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="User id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModAssignRemoveSubmissionResponse:
        """Remove submission.

        Remove submission.

        :param assignid: Assignment instance id (required)
        :type assignid: int
        :param userid: User id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_remove_submission_serialize(
            assignid=assignid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignRemoveSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_remove_submission_from_args(
        self,
        args
    ) -> ModAssignRemoveSubmissionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignRemoveSubmissionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_remove_submission_with_http_info(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="Assignment instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="User id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModAssignRemoveSubmissionResponse]:
        """Remove submission.

        Remove submission.

        :param assignid: Assignment instance id (required)
        :type assignid: int
        :param userid: User id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_remove_submission_serialize(
            assignid=assignid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignRemoveSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_remove_submission_without_preload_content(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="Assignment instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="User id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Remove submission.

        Remove submission.

        :param assignid: Assignment instance id (required)
        :type assignid: int
        :param userid: User id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_remove_submission_serialize(
            assignid=assignid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignRemoveSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_remove_submission_serialize(
        self,
        assignid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_remove_submission'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_remove_submission'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_remove_submission',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignid is not None:
            _form_params += parse_form({'assignid': assignid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_reveal_identities_args(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Reveal the identities for a blind marking assignment

        Reveal the identities for a blind marking assignment

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_reveal_identities_serialize(
            assignmentid=assignmentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_reveal_identities(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Reveal the identities for a blind marking assignment

        Reveal the identities for a blind marking assignment

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_reveal_identities_serialize(
            assignmentid=assignmentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_reveal_identities_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_reveal_identities_with_http_info(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Reveal the identities for a blind marking assignment

        Reveal the identities for a blind marking assignment

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_reveal_identities_serialize(
            assignmentid=assignmentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_reveal_identities_without_preload_content(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Reveal the identities for a blind marking assignment

        Reveal the identities for a blind marking assignment

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_reveal_identities_serialize(
            assignmentid=assignmentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_reveal_identities_serialize(
        self,
        assignmentid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_reveal_identities'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_reveal_identities'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_reveal_identities',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignmentid is not None:
            _form_params += parse_form({'assignmentid': assignmentid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_revert_submissions_to_draft_args(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        userids: Annotated[List[Optional[StrictInt]], Field(description="1 or more user ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Reverts the list of submissions to draft status

        Reverts the list of submissions to draft status

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param userids: 1 or more user ids (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_revert_submissions_to_draft_serialize(
            assignmentid=assignmentid,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_revert_submissions_to_draft(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        userids: Annotated[List[Optional[StrictInt]], Field(description="1 or more user ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Reverts the list of submissions to draft status

        Reverts the list of submissions to draft status

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param userids: 1 or more user ids (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_revert_submissions_to_draft_serialize(
            assignmentid=assignmentid,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_revert_submissions_to_draft_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_revert_submissions_to_draft_with_http_info(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        userids: Annotated[List[Optional[StrictInt]], Field(description="1 or more user ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Reverts the list of submissions to draft status

        Reverts the list of submissions to draft status

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param userids: 1 or more user ids (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_revert_submissions_to_draft_serialize(
            assignmentid=assignmentid,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_revert_submissions_to_draft_without_preload_content(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        userids: Annotated[List[Optional[StrictInt]], Field(description="1 or more user ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Reverts the list of submissions to draft status

        Reverts the list of submissions to draft status

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param userids: 1 or more user ids (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_revert_submissions_to_draft_serialize(
            assignmentid=assignmentid,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_revert_submissions_to_draft_serialize(
        self,
        assignmentid,
        userids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'userids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_revert_submissions_to_draft'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_revert_submissions_to_draft'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_revert_submissions_to_draft',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignmentid is not None:
            _form_params += parse_form({'assignmentid': assignmentid})
        if userids is not None:
            _form_params += parse_form({'userids': userids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_save_grade_args(
        self,
        addattempt: Annotated[Optional[StrictBool], Field(description="Allow another attempt if the attempt reopen method is manual")],
        applytoall: Annotated[Optional[StrictBool], Field(description="If true, this grade will be applied to all members of the group (for group assignments).")],
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        attemptnumber: Annotated[Optional[StrictInt], Field(description="The attempt number (-1 means latest attempt)")],
        grade: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The new grade for this user. Ignored if advanced grading used")],
        userid: Annotated[Optional[StrictInt], Field(description="The student id to operate on")],
        workflowstate: Annotated[Optional[StrictStr], Field(description="The next marking workflow state")],
        advancedgradingdata: Optional[ModAssignSaveGradeParametersAdvancedgradingdata] = None,
        plugindata: Optional[ModAssignSaveGradeParametersPlugindata] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Save a grade update for a single student.

        Save a grade update for a single student.

        :param addattempt: Allow another attempt if the attempt reopen method is manual (required)
        :type addattempt: bool
        :param applytoall: If true, this grade will be applied to all members of the group (for group assignments). (required)
        :type applytoall: bool
        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param attemptnumber: The attempt number (-1 means latest attempt) (required)
        :type attemptnumber: int
        :param grade: The new grade for this user. Ignored if advanced grading used (required)
        :type grade: float
        :param userid: The student id to operate on (required)
        :type userid: int
        :param workflowstate: The next marking workflow state (required)
        :type workflowstate: str
        :param advancedgradingdata:
        :type advancedgradingdata: ModAssignSaveGradeParametersAdvancedgradingdata
        :param plugindata:
        :type plugindata: ModAssignSaveGradeParametersPlugindata
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_save_grade_serialize(
            addattempt=addattempt,
            applytoall=applytoall,
            assignmentid=assignmentid,
            attemptnumber=attemptnumber,
            grade=grade,
            userid=userid,
            workflowstate=workflowstate,
            advancedgradingdata=advancedgradingdata,
            plugindata=plugindata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_save_grade(
        self,
        addattempt: Annotated[Optional[StrictBool], Field(description="Allow another attempt if the attempt reopen method is manual")],
        applytoall: Annotated[Optional[StrictBool], Field(description="If true, this grade will be applied to all members of the group (for group assignments).")],
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        attemptnumber: Annotated[Optional[StrictInt], Field(description="The attempt number (-1 means latest attempt)")],
        grade: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The new grade for this user. Ignored if advanced grading used")],
        userid: Annotated[Optional[StrictInt], Field(description="The student id to operate on")],
        workflowstate: Annotated[Optional[StrictStr], Field(description="The next marking workflow state")],
        advancedgradingdata: Optional[ModAssignSaveGradeParametersAdvancedgradingdata] = None,
        plugindata: Optional[ModAssignSaveGradeParametersPlugindata] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Save a grade update for a single student.

        Save a grade update for a single student.

        :param addattempt: Allow another attempt if the attempt reopen method is manual (required)
        :type addattempt: bool
        :param applytoall: If true, this grade will be applied to all members of the group (for group assignments). (required)
        :type applytoall: bool
        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param attemptnumber: The attempt number (-1 means latest attempt) (required)
        :type attemptnumber: int
        :param grade: The new grade for this user. Ignored if advanced grading used (required)
        :type grade: float
        :param userid: The student id to operate on (required)
        :type userid: int
        :param workflowstate: The next marking workflow state (required)
        :type workflowstate: str
        :param advancedgradingdata:
        :type advancedgradingdata: ModAssignSaveGradeParametersAdvancedgradingdata
        :param plugindata:
        :type plugindata: ModAssignSaveGradeParametersPlugindata
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_save_grade_serialize(
            addattempt=addattempt,
            applytoall=applytoall,
            assignmentid=assignmentid,
            attemptnumber=attemptnumber,
            grade=grade,
            userid=userid,
            workflowstate=workflowstate,
            advancedgradingdata=advancedgradingdata,
            plugindata=plugindata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_save_grade_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_save_grade_with_http_info(
        self,
        addattempt: Annotated[Optional[StrictBool], Field(description="Allow another attempt if the attempt reopen method is manual")],
        applytoall: Annotated[Optional[StrictBool], Field(description="If true, this grade will be applied to all members of the group (for group assignments).")],
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        attemptnumber: Annotated[Optional[StrictInt], Field(description="The attempt number (-1 means latest attempt)")],
        grade: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The new grade for this user. Ignored if advanced grading used")],
        userid: Annotated[Optional[StrictInt], Field(description="The student id to operate on")],
        workflowstate: Annotated[Optional[StrictStr], Field(description="The next marking workflow state")],
        advancedgradingdata: Optional[ModAssignSaveGradeParametersAdvancedgradingdata] = None,
        plugindata: Optional[ModAssignSaveGradeParametersPlugindata] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Save a grade update for a single student.

        Save a grade update for a single student.

        :param addattempt: Allow another attempt if the attempt reopen method is manual (required)
        :type addattempt: bool
        :param applytoall: If true, this grade will be applied to all members of the group (for group assignments). (required)
        :type applytoall: bool
        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param attemptnumber: The attempt number (-1 means latest attempt) (required)
        :type attemptnumber: int
        :param grade: The new grade for this user. Ignored if advanced grading used (required)
        :type grade: float
        :param userid: The student id to operate on (required)
        :type userid: int
        :param workflowstate: The next marking workflow state (required)
        :type workflowstate: str
        :param advancedgradingdata:
        :type advancedgradingdata: ModAssignSaveGradeParametersAdvancedgradingdata
        :param plugindata:
        :type plugindata: ModAssignSaveGradeParametersPlugindata
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_save_grade_serialize(
            addattempt=addattempt,
            applytoall=applytoall,
            assignmentid=assignmentid,
            attemptnumber=attemptnumber,
            grade=grade,
            userid=userid,
            workflowstate=workflowstate,
            advancedgradingdata=advancedgradingdata,
            plugindata=plugindata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_save_grade_without_preload_content(
        self,
        addattempt: Annotated[Optional[StrictBool], Field(description="Allow another attempt if the attempt reopen method is manual")],
        applytoall: Annotated[Optional[StrictBool], Field(description="If true, this grade will be applied to all members of the group (for group assignments).")],
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        attemptnumber: Annotated[Optional[StrictInt], Field(description="The attempt number (-1 means latest attempt)")],
        grade: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The new grade for this user. Ignored if advanced grading used")],
        userid: Annotated[Optional[StrictInt], Field(description="The student id to operate on")],
        workflowstate: Annotated[Optional[StrictStr], Field(description="The next marking workflow state")],
        advancedgradingdata: Optional[ModAssignSaveGradeParametersAdvancedgradingdata] = None,
        plugindata: Optional[ModAssignSaveGradeParametersPlugindata] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Save a grade update for a single student.

        Save a grade update for a single student.

        :param addattempt: Allow another attempt if the attempt reopen method is manual (required)
        :type addattempt: bool
        :param applytoall: If true, this grade will be applied to all members of the group (for group assignments). (required)
        :type applytoall: bool
        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param attemptnumber: The attempt number (-1 means latest attempt) (required)
        :type attemptnumber: int
        :param grade: The new grade for this user. Ignored if advanced grading used (required)
        :type grade: float
        :param userid: The student id to operate on (required)
        :type userid: int
        :param workflowstate: The next marking workflow state (required)
        :type workflowstate: str
        :param advancedgradingdata:
        :type advancedgradingdata: ModAssignSaveGradeParametersAdvancedgradingdata
        :param plugindata:
        :type plugindata: ModAssignSaveGradeParametersPlugindata
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_save_grade_serialize(
            addattempt=addattempt,
            applytoall=applytoall,
            assignmentid=assignmentid,
            attemptnumber=attemptnumber,
            grade=grade,
            userid=userid,
            workflowstate=workflowstate,
            advancedgradingdata=advancedgradingdata,
            plugindata=plugindata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_save_grade_serialize(
        self,
        addattempt,
        applytoall,
        assignmentid,
        attemptnumber,
        grade,
        userid,
        workflowstate,
        advancedgradingdata,
        plugindata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_save_grade'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_save_grade'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_save_grade',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if addattempt is not None:
            _form_params += parse_form({'addattempt': addattempt})
        if advancedgradingdata is not None:
            _form_params += parse_form({'advancedgradingdata': advancedgradingdata})
        if applytoall is not None:
            _form_params += parse_form({'applytoall': applytoall})
        if assignmentid is not None:
            _form_params += parse_form({'assignmentid': assignmentid})
        if attemptnumber is not None:
            _form_params += parse_form({'attemptnumber': attemptnumber})
        if grade is not None:
            _form_params += parse_form({'grade': grade})
        if plugindata is not None:
            _form_params += parse_form({'plugindata': plugindata})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        if workflowstate is not None:
            _form_params += parse_form({'workflowstate': workflowstate})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_save_grades_args(
        self,
        applytoall: Annotated[Optional[StrictBool], Field(description="If true, this grade will be applied to all members of the group (for group assignments).")],
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        grades: List[ModAssignSaveGradesParametersGradesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Save multiple grade updates for an assignment.

        Save multiple grade updates for an assignment.

        :param applytoall: If true, this grade will be applied to all members of the group (for group assignments). (required)
        :type applytoall: bool
        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param grades: (required)
        :type grades: List[ModAssignSaveGradesParametersGradesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_save_grades_serialize(
            applytoall=applytoall,
            assignmentid=assignmentid,
            grades=grades,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_save_grades(
        self,
        applytoall: Annotated[Optional[StrictBool], Field(description="If true, this grade will be applied to all members of the group (for group assignments).")],
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        grades: List[ModAssignSaveGradesParametersGradesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Save multiple grade updates for an assignment.

        Save multiple grade updates for an assignment.

        :param applytoall: If true, this grade will be applied to all members of the group (for group assignments). (required)
        :type applytoall: bool
        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param grades: (required)
        :type grades: List[ModAssignSaveGradesParametersGradesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_save_grades_serialize(
            applytoall=applytoall,
            assignmentid=assignmentid,
            grades=grades,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_save_grades_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_save_grades_with_http_info(
        self,
        applytoall: Annotated[Optional[StrictBool], Field(description="If true, this grade will be applied to all members of the group (for group assignments).")],
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        grades: List[ModAssignSaveGradesParametersGradesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Save multiple grade updates for an assignment.

        Save multiple grade updates for an assignment.

        :param applytoall: If true, this grade will be applied to all members of the group (for group assignments). (required)
        :type applytoall: bool
        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param grades: (required)
        :type grades: List[ModAssignSaveGradesParametersGradesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_save_grades_serialize(
            applytoall=applytoall,
            assignmentid=assignmentid,
            grades=grades,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_save_grades_without_preload_content(
        self,
        applytoall: Annotated[Optional[StrictBool], Field(description="If true, this grade will be applied to all members of the group (for group assignments).")],
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        grades: List[ModAssignSaveGradesParametersGradesInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Save multiple grade updates for an assignment.

        Save multiple grade updates for an assignment.

        :param applytoall: If true, this grade will be applied to all members of the group (for group assignments). (required)
        :type applytoall: bool
        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param grades: (required)
        :type grades: List[ModAssignSaveGradesParametersGradesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_save_grades_serialize(
            applytoall=applytoall,
            assignmentid=assignmentid,
            grades=grades,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_save_grades_serialize(
        self,
        applytoall,
        assignmentid,
        grades,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'grades': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_save_grades'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_save_grades'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_save_grades',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if applytoall is not None:
            _form_params += parse_form({'applytoall': applytoall})
        if assignmentid is not None:
            _form_params += parse_form({'assignmentid': assignmentid})
        if grades is not None:
            _form_params += parse_form({'grades': grades})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_save_submission_args(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        plugindata: ModAssignSaveSubmissionParametersPlugindata,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update the current students submission

        Update the current students submission

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param plugindata: (required)
        :type plugindata: ModAssignSaveSubmissionParametersPlugindata
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_save_submission_serialize(
            assignmentid=assignmentid,
            plugindata=plugindata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_save_submission(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        plugindata: ModAssignSaveSubmissionParametersPlugindata,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Update the current students submission

        Update the current students submission

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param plugindata: (required)
        :type plugindata: ModAssignSaveSubmissionParametersPlugindata
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_save_submission_serialize(
            assignmentid=assignmentid,
            plugindata=plugindata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_save_submission_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_save_submission_with_http_info(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        plugindata: ModAssignSaveSubmissionParametersPlugindata,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Update the current students submission

        Update the current students submission

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param plugindata: (required)
        :type plugindata: ModAssignSaveSubmissionParametersPlugindata
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_save_submission_serialize(
            assignmentid=assignmentid,
            plugindata=plugindata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_save_submission_without_preload_content(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        plugindata: ModAssignSaveSubmissionParametersPlugindata,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update the current students submission

        Update the current students submission

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param plugindata: (required)
        :type plugindata: ModAssignSaveSubmissionParametersPlugindata
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_save_submission_serialize(
            assignmentid=assignmentid,
            plugindata=plugindata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_save_submission_serialize(
        self,
        assignmentid,
        plugindata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_save_submission'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_save_submission'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_save_submission',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignmentid is not None:
            _form_params += parse_form({'assignmentid': assignmentid})
        if plugindata is not None:
            _form_params += parse_form({'plugindata': plugindata})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_save_user_extensions_args(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        dates: Annotated[List[Optional[StrictInt]], Field(description="1 or more extension dates (timestamp)")],
        userids: Annotated[List[Optional[StrictInt]], Field(description="1 or more user ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Save a list of assignment extensions

        Save a list of assignment extensions

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param dates: 1 or more extension dates (timestamp) (required)
        :type dates: List[Optional[int]]
        :param userids: 1 or more user ids (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_save_user_extensions_serialize(
            assignmentid=assignmentid,
            dates=dates,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_save_user_extensions(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        dates: Annotated[List[Optional[StrictInt]], Field(description="1 or more extension dates (timestamp)")],
        userids: Annotated[List[Optional[StrictInt]], Field(description="1 or more user ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Save a list of assignment extensions

        Save a list of assignment extensions

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param dates: 1 or more extension dates (timestamp) (required)
        :type dates: List[Optional[int]]
        :param userids: 1 or more user ids (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_save_user_extensions_serialize(
            assignmentid=assignmentid,
            dates=dates,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_save_user_extensions_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_save_user_extensions_with_http_info(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        dates: Annotated[List[Optional[StrictInt]], Field(description="1 or more extension dates (timestamp)")],
        userids: Annotated[List[Optional[StrictInt]], Field(description="1 or more user ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Save a list of assignment extensions

        Save a list of assignment extensions

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param dates: 1 or more extension dates (timestamp) (required)
        :type dates: List[Optional[int]]
        :param userids: 1 or more user ids (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_save_user_extensions_serialize(
            assignmentid=assignmentid,
            dates=dates,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_save_user_extensions_without_preload_content(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        dates: Annotated[List[Optional[StrictInt]], Field(description="1 or more extension dates (timestamp)")],
        userids: Annotated[List[Optional[StrictInt]], Field(description="1 or more user ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Save a list of assignment extensions

        Save a list of assignment extensions

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param dates: 1 or more extension dates (timestamp) (required)
        :type dates: List[Optional[int]]
        :param userids: 1 or more user ids (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_save_user_extensions_serialize(
            assignmentid=assignmentid,
            dates=dates,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_save_user_extensions_serialize(
        self,
        assignmentid,
        dates,
        userids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'dates': 'csv',
            'userids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_save_user_extensions'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_save_user_extensions'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_save_user_extensions',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignmentid is not None:
            _form_params += parse_form({'assignmentid': assignmentid})
        if dates is not None:
            _form_params += parse_form({'dates': dates})
        if userids is not None:
            _form_params += parse_form({'userids': userids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_set_user_flags_args(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="assignment id")],
        userflags: List[ModAssignSetUserFlagsParametersUserflagsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Creates or updates user flags

        Creates or updates user flags

        :param assignmentid: assignment id (required)
        :type assignmentid: int
        :param userflags: (required)
        :type userflags: List[ModAssignSetUserFlagsParametersUserflagsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_set_user_flags_serialize(
            assignmentid=assignmentid,
            userflags=userflags,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModAssignSetUserFlagsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_set_user_flags(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="assignment id")],
        userflags: List[ModAssignSetUserFlagsParametersUserflagsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[ModAssignSetUserFlagsResponseInner]:
        """Creates or updates user flags

        Creates or updates user flags

        :param assignmentid: assignment id (required)
        :type assignmentid: int
        :param userflags: (required)
        :type userflags: List[ModAssignSetUserFlagsParametersUserflagsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_set_user_flags_serialize(
            assignmentid=assignmentid,
            userflags=userflags,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModAssignSetUserFlagsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_set_user_flags_from_args(
        self,
        args
    ) -> List[ModAssignSetUserFlagsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModAssignSetUserFlagsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_set_user_flags_with_http_info(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="assignment id")],
        userflags: List[ModAssignSetUserFlagsParametersUserflagsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[ModAssignSetUserFlagsResponseInner]]:
        """Creates or updates user flags

        Creates or updates user flags

        :param assignmentid: assignment id (required)
        :type assignmentid: int
        :param userflags: (required)
        :type userflags: List[ModAssignSetUserFlagsParametersUserflagsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_set_user_flags_serialize(
            assignmentid=assignmentid,
            userflags=userflags,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModAssignSetUserFlagsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_set_user_flags_without_preload_content(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="assignment id")],
        userflags: List[ModAssignSetUserFlagsParametersUserflagsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Creates or updates user flags

        Creates or updates user flags

        :param assignmentid: assignment id (required)
        :type assignmentid: int
        :param userflags: (required)
        :type userflags: List[ModAssignSetUserFlagsParametersUserflagsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_set_user_flags_serialize(
            assignmentid=assignmentid,
            userflags=userflags,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModAssignSetUserFlagsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_set_user_flags_serialize(
        self,
        assignmentid,
        userflags,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'userflags': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_set_user_flags'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_set_user_flags'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_set_user_flags',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignmentid is not None:
            _form_params += parse_form({'assignmentid': assignmentid})
        if userflags is not None:
            _form_params += parse_form({'userflags': userflags})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_start_submission_args(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="Assignment instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Start a submission for user if assignment has a time limit.

        Start a submission for user if assignment has a time limit.

        :param assignid: Assignment instance id (required)
        :type assignid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_start_submission_serialize(
            assignid=assignid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignStartSubmissionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_start_submission(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="Assignment instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModAssignStartSubmissionResponse:
        """Start a submission for user if assignment has a time limit.

        Start a submission for user if assignment has a time limit.

        :param assignid: Assignment instance id (required)
        :type assignid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_start_submission_serialize(
            assignid=assignid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignStartSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_start_submission_from_args(
        self,
        args
    ) -> ModAssignStartSubmissionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignStartSubmissionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_start_submission_with_http_info(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="Assignment instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModAssignStartSubmissionResponse]:
        """Start a submission for user if assignment has a time limit.

        Start a submission for user if assignment has a time limit.

        :param assignid: Assignment instance id (required)
        :type assignid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_start_submission_serialize(
            assignid=assignid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignStartSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_start_submission_without_preload_content(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="Assignment instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Start a submission for user if assignment has a time limit.

        Start a submission for user if assignment has a time limit.

        :param assignid: Assignment instance id (required)
        :type assignid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_start_submission_serialize(
            assignid=assignid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignStartSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_start_submission_serialize(
        self,
        assignid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_start_submission'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_start_submission'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_start_submission',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignid is not None:
            _form_params += parse_form({'assignid': assignid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_submit_for_grading_args(
        self,
        acceptsubmissionstatement: Annotated[Optional[StrictBool], Field(description="Accept the assignment submission statement")],
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Submit the current students assignment for grading

        Submit the current students assignment for grading

        :param acceptsubmissionstatement: Accept the assignment submission statement (required)
        :type acceptsubmissionstatement: bool
        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_submit_for_grading_serialize(
            acceptsubmissionstatement=acceptsubmissionstatement,
            assignmentid=assignmentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_submit_for_grading(
        self,
        acceptsubmissionstatement: Annotated[Optional[StrictBool], Field(description="Accept the assignment submission statement")],
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Submit the current students assignment for grading

        Submit the current students assignment for grading

        :param acceptsubmissionstatement: Accept the assignment submission statement (required)
        :type acceptsubmissionstatement: bool
        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_submit_for_grading_serialize(
            acceptsubmissionstatement=acceptsubmissionstatement,
            assignmentid=assignmentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_submit_for_grading_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_submit_for_grading_with_http_info(
        self,
        acceptsubmissionstatement: Annotated[Optional[StrictBool], Field(description="Accept the assignment submission statement")],
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Submit the current students assignment for grading

        Submit the current students assignment for grading

        :param acceptsubmissionstatement: Accept the assignment submission statement (required)
        :type acceptsubmissionstatement: bool
        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_submit_for_grading_serialize(
            acceptsubmissionstatement=acceptsubmissionstatement,
            assignmentid=assignmentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_submit_for_grading_without_preload_content(
        self,
        acceptsubmissionstatement: Annotated[Optional[StrictBool], Field(description="Accept the assignment submission statement")],
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Submit the current students assignment for grading

        Submit the current students assignment for grading

        :param acceptsubmissionstatement: Accept the assignment submission statement (required)
        :type acceptsubmissionstatement: bool
        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_submit_for_grading_serialize(
            acceptsubmissionstatement=acceptsubmissionstatement,
            assignmentid=assignmentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_submit_for_grading_serialize(
        self,
        acceptsubmissionstatement,
        assignmentid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_submit_for_grading'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_submit_for_grading'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_submit_for_grading',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if acceptsubmissionstatement is not None:
            _form_params += parse_form({'acceptsubmissionstatement': acceptsubmissionstatement})
        if assignmentid is not None:
            _form_params += parse_form({'assignmentid': assignmentid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_submit_grading_form_args(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data from the grading form, encoded as a json array")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id the submission belongs to")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Submit the grading form data via ajax

        Submit the grading form data via ajax

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param jsonformdata: The data from the grading form, encoded as a json array (required)
        :type jsonformdata: str
        :param userid: The user id the submission belongs to (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_submit_grading_form_serialize(
            assignmentid=assignmentid,
            jsonformdata=jsonformdata,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_submit_grading_form(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data from the grading form, encoded as a json array")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id the submission belongs to")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Submit the grading form data via ajax

        Submit the grading form data via ajax

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param jsonformdata: The data from the grading form, encoded as a json array (required)
        :type jsonformdata: str
        :param userid: The user id the submission belongs to (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_submit_grading_form_serialize(
            assignmentid=assignmentid,
            jsonformdata=jsonformdata,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_submit_grading_form_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_submit_grading_form_with_http_info(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data from the grading form, encoded as a json array")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id the submission belongs to")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Submit the grading form data via ajax

        Submit the grading form data via ajax

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param jsonformdata: The data from the grading form, encoded as a json array (required)
        :type jsonformdata: str
        :param userid: The user id the submission belongs to (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_submit_grading_form_serialize(
            assignmentid=assignmentid,
            jsonformdata=jsonformdata,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_submit_grading_form_without_preload_content(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data from the grading form, encoded as a json array")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id the submission belongs to")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Submit the grading form data via ajax

        Submit the grading form data via ajax

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param jsonformdata: The data from the grading form, encoded as a json array (required)
        :type jsonformdata: str
        :param userid: The user id the submission belongs to (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_submit_grading_form_serialize(
            assignmentid=assignmentid,
            jsonformdata=jsonformdata,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_submit_grading_form_serialize(
        self,
        assignmentid,
        jsonformdata,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_submit_grading_form'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_submit_grading_form'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_submit_grading_form',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignmentid is not None:
            _form_params += parse_form({'assignmentid': assignmentid})
        if jsonformdata is not None:
            _form_params += parse_form({'jsonformdata': jsonformdata})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_unlock_submissions_args(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        userids: Annotated[List[Optional[StrictInt]], Field(description="1 or more user ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Allow students to make changes to a list of submissions

        Allow students to make changes to a list of submissions

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param userids: 1 or more user ids (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_unlock_submissions_serialize(
            assignmentid=assignmentid,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_unlock_submissions(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        userids: Annotated[List[Optional[StrictInt]], Field(description="1 or more user ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        """Allow students to make changes to a list of submissions

        Allow students to make changes to a list of submissions

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param userids: 1 or more user ids (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_unlock_submissions_serialize(
            assignmentid=assignmentid,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_unlock_submissions_from_args(
        self,
        args
    ) -> List[AuthEmailGetSignupSettingsResponseWarningsInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_unlock_submissions_with_http_info(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        userids: Annotated[List[Optional[StrictInt]], Field(description="1 or more user ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[AuthEmailGetSignupSettingsResponseWarningsInner]]:
        """Allow students to make changes to a list of submissions

        Allow students to make changes to a list of submissions

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param userids: 1 or more user ids (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_unlock_submissions_serialize(
            assignmentid=assignmentid,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_unlock_submissions_without_preload_content(
        self,
        assignmentid: Annotated[Optional[StrictInt], Field(description="The assignment id to operate on")],
        userids: Annotated[List[Optional[StrictInt]], Field(description="1 or more user ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Allow students to make changes to a list of submissions

        Allow students to make changes to a list of submissions

        :param assignmentid: The assignment id to operate on (required)
        :type assignmentid: int
        :param userids: 1 or more user ids (required)
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_unlock_submissions_serialize(
            assignmentid=assignmentid,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[AuthEmailGetSignupSettingsResponseWarningsInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_unlock_submissions_serialize(
        self,
        assignmentid,
        userids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'userids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_unlock_submissions'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_unlock_submissions'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_unlock_submissions',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignmentid is not None:
            _form_params += parse_form({'assignmentid': assignmentid})
        if userids is not None:
            _form_params += parse_form({'userids': userids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_view_assign_args(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update the module completion status.

        Update the module completion status.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_view_assign_serialize(
            assignid=assignid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignViewAssignResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_view_assign(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModAssignViewAssignResponse:
        """Update the module completion status.

        Update the module completion status.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_view_assign_serialize(
            assignid=assignid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignViewAssignResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_view_assign_from_args(
        self,
        args
    ) -> ModAssignViewAssignResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignViewAssignResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_view_assign_with_http_info(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModAssignViewAssignResponse]:
        """Update the module completion status.

        Update the module completion status.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_view_assign_serialize(
            assignid=assignid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignViewAssignResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_view_assign_without_preload_content(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update the module completion status.

        Update the module completion status.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_view_assign_serialize(
            assignid=assignid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignViewAssignResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_view_assign_serialize(
        self,
        assignid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_view_assign'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_view_assign'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_view_assign',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignid is not None:
            _form_params += parse_form({'assignid': assignid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_view_grading_table_args(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the grading_table_viewed event.

        Trigger the grading_table_viewed event.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_view_grading_table_serialize(
            assignid=assignid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignViewGradingTableResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_view_grading_table(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModAssignViewGradingTableResponse:
        """Trigger the grading_table_viewed event.

        Trigger the grading_table_viewed event.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_view_grading_table_serialize(
            assignid=assignid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignViewGradingTableResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_view_grading_table_from_args(
        self,
        args
    ) -> ModAssignViewGradingTableResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignViewGradingTableResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_view_grading_table_with_http_info(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModAssignViewGradingTableResponse]:
        """Trigger the grading_table_viewed event.

        Trigger the grading_table_viewed event.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_view_grading_table_serialize(
            assignid=assignid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignViewGradingTableResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_view_grading_table_without_preload_content(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the grading_table_viewed event.

        Trigger the grading_table_viewed event.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_view_grading_table_serialize(
            assignid=assignid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignViewGradingTableResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_view_grading_table_serialize(
        self,
        assignid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_view_grading_table'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_view_grading_table'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_view_grading_table',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignid is not None:
            _form_params += parse_form({'assignid': assignid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_assign_view_submission_status_args(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the submission status viewed event.

        Trigger the submission status viewed event.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_view_submission_status_serialize(
            assignid=assignid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignViewSubmissionStatusResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_assign_view_submission_status(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModAssignViewSubmissionStatusResponse:
        """Trigger the submission status viewed event.

        Trigger the submission status viewed event.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_view_submission_status_serialize(
            assignid=assignid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignViewSubmissionStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_view_submission_status_from_args(
        self,
        args
    ) -> ModAssignViewSubmissionStatusResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignViewSubmissionStatusResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_assign_view_submission_status_with_http_info(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModAssignViewSubmissionStatusResponse]:
        """Trigger the submission status viewed event.

        Trigger the submission status viewed event.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_view_submission_status_serialize(
            assignid=assignid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignViewSubmissionStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_assign_view_submission_status_without_preload_content(
        self,
        assignid: Annotated[Optional[StrictInt], Field(description="assign instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the submission status viewed event.

        Trigger the submission status viewed event.

        :param assignid: assign instance id (required)
        :type assignid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_assign_view_submission_status_serialize(
            assignid=assignid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModAssignViewSubmissionStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_assign_view_submission_status_serialize(
        self,
        assignid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_assign_view_submission_status'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_assign_view_submission_status'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_assign_view_submission_status',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assignid is not None:
            _form_params += parse_form({'assignid': assignid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_bigbluebuttonbn_can_join_args(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        groupid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn group id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns information if the current user can join or not.

        Returns information if the current user can join or not.

        :param cmid: course module id (required)
        :type cmid: int
        :param groupid: bigbluebuttonbn group id
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_can_join_serialize(
            cmid=cmid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnCanJoinResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_bigbluebuttonbn_can_join(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        groupid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn group id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModBigbluebuttonbnCanJoinResponse:
        """Returns information if the current user can join or not.

        Returns information if the current user can join or not.

        :param cmid: course module id (required)
        :type cmid: int
        :param groupid: bigbluebuttonbn group id
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_can_join_serialize(
            cmid=cmid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnCanJoinResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_can_join_from_args(
        self,
        args
    ) -> ModBigbluebuttonbnCanJoinResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnCanJoinResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_can_join_with_http_info(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        groupid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn group id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModBigbluebuttonbnCanJoinResponse]:
        """Returns information if the current user can join or not.

        Returns information if the current user can join or not.

        :param cmid: course module id (required)
        :type cmid: int
        :param groupid: bigbluebuttonbn group id
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_can_join_serialize(
            cmid=cmid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnCanJoinResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_bigbluebuttonbn_can_join_without_preload_content(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        groupid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn group id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns information if the current user can join or not.

        Returns information if the current user can join or not.

        :param cmid: course module id (required)
        :type cmid: int
        :param groupid: bigbluebuttonbn group id
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_can_join_serialize(
            cmid=cmid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnCanJoinResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_bigbluebuttonbn_can_join_serialize(
        self,
        cmid,
        groupid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_bigbluebuttonbn_can_join'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_bigbluebuttonbn_can_join'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_bigbluebuttonbn_can_join',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_bigbluebuttonbn_completion_validate_args(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Validate completion

        Validate completion

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_completion_validate_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnCompletionValidateResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_bigbluebuttonbn_completion_validate(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModBigbluebuttonbnCompletionValidateResponse:
        """Validate completion

        Validate completion

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_completion_validate_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnCompletionValidateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_completion_validate_from_args(
        self,
        args
    ) -> ModBigbluebuttonbnCompletionValidateResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnCompletionValidateResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_completion_validate_with_http_info(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModBigbluebuttonbnCompletionValidateResponse]:
        """Validate completion

        Validate completion

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_completion_validate_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnCompletionValidateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_bigbluebuttonbn_completion_validate_without_preload_content(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Validate completion

        Validate completion

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_completion_validate_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnCompletionValidateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_bigbluebuttonbn_completion_validate_serialize(
        self,
        bigbluebuttonbnid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_bigbluebuttonbn_completion_validate'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_bigbluebuttonbn_completion_validate'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_bigbluebuttonbn_completion_validate',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if bigbluebuttonbnid is not None:
            _form_params += parse_form({'bigbluebuttonbnid': bigbluebuttonbnid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_bigbluebuttonbn_end_meeting_args(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn group id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """End a meeting

        End a meeting

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param groupid: bigbluebuttonbn group id
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_end_meeting_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnEndMeetingResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_bigbluebuttonbn_end_meeting(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn group id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModBigbluebuttonbnEndMeetingResponse:
        """End a meeting

        End a meeting

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param groupid: bigbluebuttonbn group id
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_end_meeting_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnEndMeetingResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_end_meeting_from_args(
        self,
        args
    ) -> ModBigbluebuttonbnEndMeetingResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnEndMeetingResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_end_meeting_with_http_info(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn group id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModBigbluebuttonbnEndMeetingResponse]:
        """End a meeting

        End a meeting

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param groupid: bigbluebuttonbn group id
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_end_meeting_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnEndMeetingResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_bigbluebuttonbn_end_meeting_without_preload_content(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn group id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """End a meeting

        End a meeting

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param groupid: bigbluebuttonbn group id
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_end_meeting_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnEndMeetingResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_bigbluebuttonbn_end_meeting_serialize(
        self,
        bigbluebuttonbnid,
        groupid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_bigbluebuttonbn_end_meeting'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_bigbluebuttonbn_end_meeting'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_bigbluebuttonbn_end_meeting',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if bigbluebuttonbnid is not None:
            _form_params += parse_form({'bigbluebuttonbnid': bigbluebuttonbnid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_bigbluebuttonbn_get_bigbluebuttonbns_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of bigbluebuttonbns in a provided list of courses, if no list is provided                             all bigbluebuttonbns that the user can view will be returned.

        Returns a list of bigbluebuttonbns in a provided list of courses, if no list is provided                             all bigbluebuttonbns that the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_get_bigbluebuttonbns_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetBigbluebuttonbnsByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_bigbluebuttonbn_get_bigbluebuttonbns_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModBigbluebuttonbnGetBigbluebuttonbnsByCoursesResponse:
        """Returns a list of bigbluebuttonbns in a provided list of courses, if no list is provided                             all bigbluebuttonbns that the user can view will be returned.

        Returns a list of bigbluebuttonbns in a provided list of courses, if no list is provided                             all bigbluebuttonbns that the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_get_bigbluebuttonbns_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetBigbluebuttonbnsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_get_bigbluebuttonbns_by_courses_from_args(
        self,
        args
    ) -> ModBigbluebuttonbnGetBigbluebuttonbnsByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetBigbluebuttonbnsByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_get_bigbluebuttonbns_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModBigbluebuttonbnGetBigbluebuttonbnsByCoursesResponse]:
        """Returns a list of bigbluebuttonbns in a provided list of courses, if no list is provided                             all bigbluebuttonbns that the user can view will be returned.

        Returns a list of bigbluebuttonbns in a provided list of courses, if no list is provided                             all bigbluebuttonbns that the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_get_bigbluebuttonbns_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetBigbluebuttonbnsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_bigbluebuttonbn_get_bigbluebuttonbns_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of bigbluebuttonbns in a provided list of courses, if no list is provided                             all bigbluebuttonbns that the user can view will be returned.

        Returns a list of bigbluebuttonbns in a provided list of courses, if no list is provided                             all bigbluebuttonbns that the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_get_bigbluebuttonbns_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetBigbluebuttonbnsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_bigbluebuttonbn_get_bigbluebuttonbns_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_bigbluebuttonbn_get_bigbluebuttonbns_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_bigbluebuttonbn_get_bigbluebuttonbns_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_bigbluebuttonbn_get_bigbluebuttonbns_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_bigbluebuttonbn_get_join_url_args(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        groupid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn group id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the join URL for the meeting and create if it does not exist.

        Get the join URL for the meeting and create if it does not exist.

        :param cmid: course module id (required)
        :type cmid: int
        :param groupid: bigbluebuttonbn group id
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_get_join_url_serialize(
            cmid=cmid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetJoinUrlResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_bigbluebuttonbn_get_join_url(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        groupid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn group id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModBigbluebuttonbnGetJoinUrlResponse:
        """Get the join URL for the meeting and create if it does not exist.

        Get the join URL for the meeting and create if it does not exist.

        :param cmid: course module id (required)
        :type cmid: int
        :param groupid: bigbluebuttonbn group id
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_get_join_url_serialize(
            cmid=cmid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetJoinUrlResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_get_join_url_from_args(
        self,
        args
    ) -> ModBigbluebuttonbnGetJoinUrlResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetJoinUrlResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_get_join_url_with_http_info(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        groupid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn group id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModBigbluebuttonbnGetJoinUrlResponse]:
        """Get the join URL for the meeting and create if it does not exist.

        Get the join URL for the meeting and create if it does not exist.

        :param cmid: course module id (required)
        :type cmid: int
        :param groupid: bigbluebuttonbn group id
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_get_join_url_serialize(
            cmid=cmid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetJoinUrlResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_bigbluebuttonbn_get_join_url_without_preload_content(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="course module id")],
        groupid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn group id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the join URL for the meeting and create if it does not exist.

        Get the join URL for the meeting and create if it does not exist.

        :param cmid: course module id (required)
        :type cmid: int
        :param groupid: bigbluebuttonbn group id
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_get_join_url_serialize(
            cmid=cmid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetJoinUrlResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_bigbluebuttonbn_get_join_url_serialize(
        self,
        cmid,
        groupid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_bigbluebuttonbn_get_join_url'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_bigbluebuttonbn_get_join_url'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_bigbluebuttonbn_get_join_url',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_bigbluebuttonbn_get_recordings_args(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group ID")] = None,
        tools: Annotated[Optional[StrictStr], Field(description="a set of enabled tools")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of recordings ready to be processed by a datatable.

        Returns a list of recordings ready to be processed by a datatable.

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param groupid: Group ID
        :type groupid: int
        :param tools: a set of enabled tools
        :type tools: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_get_recordings_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            groupid=groupid,
            tools=tools,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetRecordingsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_bigbluebuttonbn_get_recordings(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group ID")] = None,
        tools: Annotated[Optional[StrictStr], Field(description="a set of enabled tools")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModBigbluebuttonbnGetRecordingsResponse:
        """Returns a list of recordings ready to be processed by a datatable.

        Returns a list of recordings ready to be processed by a datatable.

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param groupid: Group ID
        :type groupid: int
        :param tools: a set of enabled tools
        :type tools: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_get_recordings_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            groupid=groupid,
            tools=tools,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetRecordingsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_get_recordings_from_args(
        self,
        args
    ) -> ModBigbluebuttonbnGetRecordingsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetRecordingsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_get_recordings_with_http_info(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group ID")] = None,
        tools: Annotated[Optional[StrictStr], Field(description="a set of enabled tools")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModBigbluebuttonbnGetRecordingsResponse]:
        """Returns a list of recordings ready to be processed by a datatable.

        Returns a list of recordings ready to be processed by a datatable.

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param groupid: Group ID
        :type groupid: int
        :param tools: a set of enabled tools
        :type tools: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_get_recordings_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            groupid=groupid,
            tools=tools,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetRecordingsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_bigbluebuttonbn_get_recordings_without_preload_content(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group ID")] = None,
        tools: Annotated[Optional[StrictStr], Field(description="a set of enabled tools")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of recordings ready to be processed by a datatable.

        Returns a list of recordings ready to be processed by a datatable.

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param groupid: Group ID
        :type groupid: int
        :param tools: a set of enabled tools
        :type tools: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_get_recordings_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            groupid=groupid,
            tools=tools,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetRecordingsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_bigbluebuttonbn_get_recordings_serialize(
        self,
        bigbluebuttonbnid,
        groupid,
        tools,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_bigbluebuttonbn_get_recordings'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_bigbluebuttonbn_get_recordings'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_bigbluebuttonbn_get_recordings',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if bigbluebuttonbnid is not None:
            _form_params += parse_form({'bigbluebuttonbnid': bigbluebuttonbnid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if tools is not None:
            _form_params += parse_form({'tools': tools})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_bigbluebuttonbn_get_recordings_to_import_args(
        self,
        destinationinstanceid: Annotated[Optional[StrictInt], Field(description="Id of the other BBB we target for importing recordings into.                 The idea here is to remove already imported recordings.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group ID")] = None,
        sourcebigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")] = None,
        sourcecourseid: Annotated[Optional[StrictInt], Field(description="source courseid to filter by")] = None,
        tools: Annotated[Optional[StrictStr], Field(description="a set of enabled tools")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of recordings ready to import to be processed by a datatable.

        Returns a list of recordings ready to import to be processed by a datatable.

        :param destinationinstanceid: Id of the other BBB we target for importing recordings into.                 The idea here is to remove already imported recordings. (required)
        :type destinationinstanceid: int
        :param groupid: Group ID
        :type groupid: int
        :param sourcebigbluebuttonbnid: bigbluebuttonbn instance id
        :type sourcebigbluebuttonbnid: int
        :param sourcecourseid: source courseid to filter by
        :type sourcecourseid: int
        :param tools: a set of enabled tools
        :type tools: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_get_recordings_to_import_serialize(
            destinationinstanceid=destinationinstanceid,
            groupid=groupid,
            sourcebigbluebuttonbnid=sourcebigbluebuttonbnid,
            sourcecourseid=sourcecourseid,
            tools=tools,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetRecordingsToImportResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_bigbluebuttonbn_get_recordings_to_import(
        self,
        destinationinstanceid: Annotated[Optional[StrictInt], Field(description="Id of the other BBB we target for importing recordings into.                 The idea here is to remove already imported recordings.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group ID")] = None,
        sourcebigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")] = None,
        sourcecourseid: Annotated[Optional[StrictInt], Field(description="source courseid to filter by")] = None,
        tools: Annotated[Optional[StrictStr], Field(description="a set of enabled tools")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModBigbluebuttonbnGetRecordingsToImportResponse:
        """Returns a list of recordings ready to import to be processed by a datatable.

        Returns a list of recordings ready to import to be processed by a datatable.

        :param destinationinstanceid: Id of the other BBB we target for importing recordings into.                 The idea here is to remove already imported recordings. (required)
        :type destinationinstanceid: int
        :param groupid: Group ID
        :type groupid: int
        :param sourcebigbluebuttonbnid: bigbluebuttonbn instance id
        :type sourcebigbluebuttonbnid: int
        :param sourcecourseid: source courseid to filter by
        :type sourcecourseid: int
        :param tools: a set of enabled tools
        :type tools: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_get_recordings_to_import_serialize(
            destinationinstanceid=destinationinstanceid,
            groupid=groupid,
            sourcebigbluebuttonbnid=sourcebigbluebuttonbnid,
            sourcecourseid=sourcecourseid,
            tools=tools,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetRecordingsToImportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_get_recordings_to_import_from_args(
        self,
        args
    ) -> ModBigbluebuttonbnGetRecordingsToImportResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetRecordingsToImportResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_get_recordings_to_import_with_http_info(
        self,
        destinationinstanceid: Annotated[Optional[StrictInt], Field(description="Id of the other BBB we target for importing recordings into.                 The idea here is to remove already imported recordings.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group ID")] = None,
        sourcebigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")] = None,
        sourcecourseid: Annotated[Optional[StrictInt], Field(description="source courseid to filter by")] = None,
        tools: Annotated[Optional[StrictStr], Field(description="a set of enabled tools")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModBigbluebuttonbnGetRecordingsToImportResponse]:
        """Returns a list of recordings ready to import to be processed by a datatable.

        Returns a list of recordings ready to import to be processed by a datatable.

        :param destinationinstanceid: Id of the other BBB we target for importing recordings into.                 The idea here is to remove already imported recordings. (required)
        :type destinationinstanceid: int
        :param groupid: Group ID
        :type groupid: int
        :param sourcebigbluebuttonbnid: bigbluebuttonbn instance id
        :type sourcebigbluebuttonbnid: int
        :param sourcecourseid: source courseid to filter by
        :type sourcecourseid: int
        :param tools: a set of enabled tools
        :type tools: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_get_recordings_to_import_serialize(
            destinationinstanceid=destinationinstanceid,
            groupid=groupid,
            sourcebigbluebuttonbnid=sourcebigbluebuttonbnid,
            sourcecourseid=sourcecourseid,
            tools=tools,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetRecordingsToImportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_bigbluebuttonbn_get_recordings_to_import_without_preload_content(
        self,
        destinationinstanceid: Annotated[Optional[StrictInt], Field(description="Id of the other BBB we target for importing recordings into.                 The idea here is to remove already imported recordings.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group ID")] = None,
        sourcebigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")] = None,
        sourcecourseid: Annotated[Optional[StrictInt], Field(description="source courseid to filter by")] = None,
        tools: Annotated[Optional[StrictStr], Field(description="a set of enabled tools")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of recordings ready to import to be processed by a datatable.

        Returns a list of recordings ready to import to be processed by a datatable.

        :param destinationinstanceid: Id of the other BBB we target for importing recordings into.                 The idea here is to remove already imported recordings. (required)
        :type destinationinstanceid: int
        :param groupid: Group ID
        :type groupid: int
        :param sourcebigbluebuttonbnid: bigbluebuttonbn instance id
        :type sourcebigbluebuttonbnid: int
        :param sourcecourseid: source courseid to filter by
        :type sourcecourseid: int
        :param tools: a set of enabled tools
        :type tools: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_get_recordings_to_import_serialize(
            destinationinstanceid=destinationinstanceid,
            groupid=groupid,
            sourcebigbluebuttonbnid=sourcebigbluebuttonbnid,
            sourcecourseid=sourcecourseid,
            tools=tools,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnGetRecordingsToImportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_bigbluebuttonbn_get_recordings_to_import_serialize(
        self,
        destinationinstanceid,
        groupid,
        sourcebigbluebuttonbnid,
        sourcecourseid,
        tools,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_bigbluebuttonbn_get_recordings_to_import'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_bigbluebuttonbn_get_recordings_to_import'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_bigbluebuttonbn_get_recordings_to_import',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if destinationinstanceid is not None:
            _form_params += parse_form({'destinationinstanceid': destinationinstanceid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if sourcebigbluebuttonbnid is not None:
            _form_params += parse_form({'sourcebigbluebuttonbnid': sourcebigbluebuttonbnid})
        if sourcecourseid is not None:
            _form_params += parse_form({'sourcecourseid': sourcecourseid})
        if tools is not None:
            _form_params += parse_form({'tools': tools})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_bigbluebuttonbn_meeting_info_args(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn group id")] = None,
        updatecache: Annotated[Optional[StrictBool], Field(description="update cache ?")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get displayable information on the meeting

        Get displayable information on the meeting

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param groupid: bigbluebuttonbn group id
        :type groupid: int
        :param updatecache: update cache ?
        :type updatecache: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_meeting_info_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            groupid=groupid,
            updatecache=updatecache,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnMeetingInfoResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_bigbluebuttonbn_meeting_info(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn group id")] = None,
        updatecache: Annotated[Optional[StrictBool], Field(description="update cache ?")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModBigbluebuttonbnMeetingInfoResponse:
        """Get displayable information on the meeting

        Get displayable information on the meeting

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param groupid: bigbluebuttonbn group id
        :type groupid: int
        :param updatecache: update cache ?
        :type updatecache: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_meeting_info_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            groupid=groupid,
            updatecache=updatecache,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnMeetingInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_meeting_info_from_args(
        self,
        args
    ) -> ModBigbluebuttonbnMeetingInfoResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnMeetingInfoResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_meeting_info_with_http_info(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn group id")] = None,
        updatecache: Annotated[Optional[StrictBool], Field(description="update cache ?")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModBigbluebuttonbnMeetingInfoResponse]:
        """Get displayable information on the meeting

        Get displayable information on the meeting

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param groupid: bigbluebuttonbn group id
        :type groupid: int
        :param updatecache: update cache ?
        :type updatecache: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_meeting_info_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            groupid=groupid,
            updatecache=updatecache,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnMeetingInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_bigbluebuttonbn_meeting_info_without_preload_content(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn group id")] = None,
        updatecache: Annotated[Optional[StrictBool], Field(description="update cache ?")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get displayable information on the meeting

        Get displayable information on the meeting

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param groupid: bigbluebuttonbn group id
        :type groupid: int
        :param updatecache: update cache ?
        :type updatecache: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_meeting_info_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            groupid=groupid,
            updatecache=updatecache,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnMeetingInfoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_bigbluebuttonbn_meeting_info_serialize(
        self,
        bigbluebuttonbnid,
        groupid,
        updatecache,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_bigbluebuttonbn_meeting_info'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_bigbluebuttonbn_meeting_info'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_bigbluebuttonbn_meeting_info',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if bigbluebuttonbnid is not None:
            _form_params += parse_form({'bigbluebuttonbnid': bigbluebuttonbnid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if updatecache is not None:
            _form_params += parse_form({'updatecache': updatecache})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_bigbluebuttonbn_update_recording_args(
        self,
        action: Annotated[Optional[StrictStr], Field(description="The action to perform")],
        additionaloptions: Annotated[Optional[StrictStr], Field(description="Additional options")],
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id, this might be a different one from the one set in recordingid in case of importing")],
        recordingid: Annotated[Optional[StrictInt], Field(description="The moodle internal recording ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update a single recording

        Update a single recording

        :param action: The action to perform (required)
        :type action: str
        :param additionaloptions: Additional options (required)
        :type additionaloptions: str
        :param bigbluebuttonbnid: bigbluebuttonbn instance id, this might be a different one from the one set in recordingid in case of importing (required)
        :type bigbluebuttonbnid: int
        :param recordingid: The moodle internal recording ID (required)
        :type recordingid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_update_recording_serialize(
            action=action,
            additionaloptions=additionaloptions,
            bigbluebuttonbnid=bigbluebuttonbnid,
            recordingid=recordingid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_bigbluebuttonbn_update_recording(
        self,
        action: Annotated[Optional[StrictStr], Field(description="The action to perform")],
        additionaloptions: Annotated[Optional[StrictStr], Field(description="Additional options")],
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id, this might be a different one from the one set in recordingid in case of importing")],
        recordingid: Annotated[Optional[StrictInt], Field(description="The moodle internal recording ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Update a single recording

        Update a single recording

        :param action: The action to perform (required)
        :type action: str
        :param additionaloptions: Additional options (required)
        :type additionaloptions: str
        :param bigbluebuttonbnid: bigbluebuttonbn instance id, this might be a different one from the one set in recordingid in case of importing (required)
        :type bigbluebuttonbnid: int
        :param recordingid: The moodle internal recording ID (required)
        :type recordingid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_update_recording_serialize(
            action=action,
            additionaloptions=additionaloptions,
            bigbluebuttonbnid=bigbluebuttonbnid,
            recordingid=recordingid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_update_recording_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_update_recording_with_http_info(
        self,
        action: Annotated[Optional[StrictStr], Field(description="The action to perform")],
        additionaloptions: Annotated[Optional[StrictStr], Field(description="Additional options")],
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id, this might be a different one from the one set in recordingid in case of importing")],
        recordingid: Annotated[Optional[StrictInt], Field(description="The moodle internal recording ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Update a single recording

        Update a single recording

        :param action: The action to perform (required)
        :type action: str
        :param additionaloptions: Additional options (required)
        :type additionaloptions: str
        :param bigbluebuttonbnid: bigbluebuttonbn instance id, this might be a different one from the one set in recordingid in case of importing (required)
        :type bigbluebuttonbnid: int
        :param recordingid: The moodle internal recording ID (required)
        :type recordingid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_update_recording_serialize(
            action=action,
            additionaloptions=additionaloptions,
            bigbluebuttonbnid=bigbluebuttonbnid,
            recordingid=recordingid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_bigbluebuttonbn_update_recording_without_preload_content(
        self,
        action: Annotated[Optional[StrictStr], Field(description="The action to perform")],
        additionaloptions: Annotated[Optional[StrictStr], Field(description="Additional options")],
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id, this might be a different one from the one set in recordingid in case of importing")],
        recordingid: Annotated[Optional[StrictInt], Field(description="The moodle internal recording ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update a single recording

        Update a single recording

        :param action: The action to perform (required)
        :type action: str
        :param additionaloptions: Additional options (required)
        :type additionaloptions: str
        :param bigbluebuttonbnid: bigbluebuttonbn instance id, this might be a different one from the one set in recordingid in case of importing (required)
        :type bigbluebuttonbnid: int
        :param recordingid: The moodle internal recording ID (required)
        :type recordingid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_update_recording_serialize(
            action=action,
            additionaloptions=additionaloptions,
            bigbluebuttonbnid=bigbluebuttonbnid,
            recordingid=recordingid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_bigbluebuttonbn_update_recording_serialize(
        self,
        action,
        additionaloptions,
        bigbluebuttonbnid,
        recordingid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_bigbluebuttonbn_update_recording'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_bigbluebuttonbn_update_recording'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_bigbluebuttonbn_update_recording',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if action is not None:
            _form_params += parse_form({'action': action})
        if additionaloptions is not None:
            _form_params += parse_form({'additionaloptions': additionaloptions})
        if bigbluebuttonbnid is not None:
            _form_params += parse_form({'bigbluebuttonbnid': bigbluebuttonbnid})
        if recordingid is not None:
            _form_params += parse_form({'recordingid': recordingid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_bigbluebuttonbn_view_bigbluebuttonbn_args(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_view_bigbluebuttonbn_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnViewBigbluebuttonbnResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_bigbluebuttonbn_view_bigbluebuttonbn(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModBigbluebuttonbnViewBigbluebuttonbnResponse:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_view_bigbluebuttonbn_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnViewBigbluebuttonbnResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_view_bigbluebuttonbn_from_args(
        self,
        args
    ) -> ModBigbluebuttonbnViewBigbluebuttonbnResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnViewBigbluebuttonbnResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_bigbluebuttonbn_view_bigbluebuttonbn_with_http_info(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModBigbluebuttonbnViewBigbluebuttonbnResponse]:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_view_bigbluebuttonbn_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnViewBigbluebuttonbnResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_bigbluebuttonbn_view_bigbluebuttonbn_without_preload_content(
        self,
        bigbluebuttonbnid: Annotated[Optional[StrictInt], Field(description="bigbluebuttonbn instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param bigbluebuttonbnid: bigbluebuttonbn instance id (required)
        :type bigbluebuttonbnid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_bigbluebuttonbn_view_bigbluebuttonbn_serialize(
            bigbluebuttonbnid=bigbluebuttonbnid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBigbluebuttonbnViewBigbluebuttonbnResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_bigbluebuttonbn_view_bigbluebuttonbn_serialize(
        self,
        bigbluebuttonbnid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_bigbluebuttonbn_view_bigbluebuttonbn'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_bigbluebuttonbn_view_bigbluebuttonbn'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_bigbluebuttonbn_view_bigbluebuttonbn',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if bigbluebuttonbnid is not None:
            _form_params += parse_form({'bigbluebuttonbnid': bigbluebuttonbnid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_book_get_books_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of book instances in a provided set of courses,                             if no courses are provided then all the book instances the user has access to will be returned.

        Returns a list of book instances in a provided set of courses,                             if no courses are provided then all the book instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_book_get_books_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBookGetBooksByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_book_get_books_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModBookGetBooksByCoursesResponse:
        """Returns a list of book instances in a provided set of courses,                             if no courses are provided then all the book instances the user has access to will be returned.

        Returns a list of book instances in a provided set of courses,                             if no courses are provided then all the book instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_book_get_books_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBookGetBooksByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_book_get_books_by_courses_from_args(
        self,
        args
    ) -> ModBookGetBooksByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBookGetBooksByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_book_get_books_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModBookGetBooksByCoursesResponse]:
        """Returns a list of book instances in a provided set of courses,                             if no courses are provided then all the book instances the user has access to will be returned.

        Returns a list of book instances in a provided set of courses,                             if no courses are provided then all the book instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_book_get_books_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBookGetBooksByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_book_get_books_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of book instances in a provided set of courses,                             if no courses are provided then all the book instances the user has access to will be returned.

        Returns a list of book instances in a provided set of courses,                             if no courses are provided then all the book instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_book_get_books_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBookGetBooksByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_book_get_books_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_book_get_books_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_book_get_books_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_book_get_books_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_book_view_book_args(
        self,
        bookid: Annotated[Optional[StrictInt], Field(description="book instance id")],
        chapterid: Annotated[Optional[StrictInt], Field(description="chapter id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Simulate the view.php web interface book: trigger events, completion, etc...

        Simulate the view.php web interface book: trigger events, completion, etc...

        :param bookid: book instance id (required)
        :type bookid: int
        :param chapterid: chapter id
        :type chapterid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_book_view_book_serialize(
            bookid=bookid,
            chapterid=chapterid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBookViewBookResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_book_view_book(
        self,
        bookid: Annotated[Optional[StrictInt], Field(description="book instance id")],
        chapterid: Annotated[Optional[StrictInt], Field(description="chapter id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModBookViewBookResponse:
        """Simulate the view.php web interface book: trigger events, completion, etc...

        Simulate the view.php web interface book: trigger events, completion, etc...

        :param bookid: book instance id (required)
        :type bookid: int
        :param chapterid: chapter id
        :type chapterid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_book_view_book_serialize(
            bookid=bookid,
            chapterid=chapterid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBookViewBookResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_book_view_book_from_args(
        self,
        args
    ) -> ModBookViewBookResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBookViewBookResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_book_view_book_with_http_info(
        self,
        bookid: Annotated[Optional[StrictInt], Field(description="book instance id")],
        chapterid: Annotated[Optional[StrictInt], Field(description="chapter id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModBookViewBookResponse]:
        """Simulate the view.php web interface book: trigger events, completion, etc...

        Simulate the view.php web interface book: trigger events, completion, etc...

        :param bookid: book instance id (required)
        :type bookid: int
        :param chapterid: chapter id
        :type chapterid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_book_view_book_serialize(
            bookid=bookid,
            chapterid=chapterid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBookViewBookResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_book_view_book_without_preload_content(
        self,
        bookid: Annotated[Optional[StrictInt], Field(description="book instance id")],
        chapterid: Annotated[Optional[StrictInt], Field(description="chapter id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Simulate the view.php web interface book: trigger events, completion, etc...

        Simulate the view.php web interface book: trigger events, completion, etc...

        :param bookid: book instance id (required)
        :type bookid: int
        :param chapterid: chapter id
        :type chapterid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_book_view_book_serialize(
            bookid=bookid,
            chapterid=chapterid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModBookViewBookResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_book_view_book_serialize(
        self,
        bookid,
        chapterid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_book_view_book'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_book_view_book'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_book_view_book',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if bookid is not None:
            _form_params += parse_form({'bookid': bookid})
        if chapterid is not None:
            _form_params += parse_form({'chapterid': chapterid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_choice_delete_choice_responses_args(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        responses: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of response ids, empty for deleting all the current user responses.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete the given submitted responses in a choice

        Delete the given submitted responses in a choice

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param responses: Array of response ids, empty for deleting all the current user responses.
        :type responses: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_delete_choice_responses_serialize(
            choiceid=choiceid,
            responses=responses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceDeleteChoiceResponsesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_choice_delete_choice_responses(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        responses: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of response ids, empty for deleting all the current user responses.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModChoiceDeleteChoiceResponsesResponse:
        """Delete the given submitted responses in a choice

        Delete the given submitted responses in a choice

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param responses: Array of response ids, empty for deleting all the current user responses.
        :type responses: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_delete_choice_responses_serialize(
            choiceid=choiceid,
            responses=responses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceDeleteChoiceResponsesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_choice_delete_choice_responses_from_args(
        self,
        args
    ) -> ModChoiceDeleteChoiceResponsesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceDeleteChoiceResponsesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_choice_delete_choice_responses_with_http_info(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        responses: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of response ids, empty for deleting all the current user responses.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModChoiceDeleteChoiceResponsesResponse]:
        """Delete the given submitted responses in a choice

        Delete the given submitted responses in a choice

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param responses: Array of response ids, empty for deleting all the current user responses.
        :type responses: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_delete_choice_responses_serialize(
            choiceid=choiceid,
            responses=responses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceDeleteChoiceResponsesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_choice_delete_choice_responses_without_preload_content(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        responses: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of response ids, empty for deleting all the current user responses.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete the given submitted responses in a choice

        Delete the given submitted responses in a choice

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param responses: Array of response ids, empty for deleting all the current user responses.
        :type responses: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_delete_choice_responses_serialize(
            choiceid=choiceid,
            responses=responses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceDeleteChoiceResponsesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_choice_delete_choice_responses_serialize(
        self,
        choiceid,
        responses,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'responses': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_choice_delete_choice_responses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_choice_delete_choice_responses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_choice_delete_choice_responses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if choiceid is not None:
            _form_params += parse_form({'choiceid': choiceid})
        if responses is not None:
            _form_params += parse_form({'responses': responses})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_choice_get_choice_options_args(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve options for a specific choice.

        Retrieve options for a specific choice.

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_get_choice_options_serialize(
            choiceid=choiceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceGetChoiceOptionsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_choice_get_choice_options(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModChoiceGetChoiceOptionsResponse:
        """Retrieve options for a specific choice.

        Retrieve options for a specific choice.

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_get_choice_options_serialize(
            choiceid=choiceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceGetChoiceOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_choice_get_choice_options_from_args(
        self,
        args
    ) -> ModChoiceGetChoiceOptionsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceGetChoiceOptionsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_choice_get_choice_options_with_http_info(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModChoiceGetChoiceOptionsResponse]:
        """Retrieve options for a specific choice.

        Retrieve options for a specific choice.

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_get_choice_options_serialize(
            choiceid=choiceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceGetChoiceOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_choice_get_choice_options_without_preload_content(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve options for a specific choice.

        Retrieve options for a specific choice.

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_get_choice_options_serialize(
            choiceid=choiceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceGetChoiceOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_choice_get_choice_options_serialize(
        self,
        choiceid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_choice_get_choice_options'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_choice_get_choice_options'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_choice_get_choice_options',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if choiceid is not None:
            _form_params += parse_form({'choiceid': choiceid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_choice_get_choice_results_args(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group ID. 0 for all participants, empty for active group.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve users results for a given choice.

        Retrieve users results for a given choice.

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param groupid: Group ID. 0 for all participants, empty for active group.
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_get_choice_results_serialize(
            choiceid=choiceid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceGetChoiceResultsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_choice_get_choice_results(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group ID. 0 for all participants, empty for active group.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModChoiceGetChoiceResultsResponse:
        """Retrieve users results for a given choice.

        Retrieve users results for a given choice.

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param groupid: Group ID. 0 for all participants, empty for active group.
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_get_choice_results_serialize(
            choiceid=choiceid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceGetChoiceResultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_choice_get_choice_results_from_args(
        self,
        args
    ) -> ModChoiceGetChoiceResultsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceGetChoiceResultsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_choice_get_choice_results_with_http_info(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group ID. 0 for all participants, empty for active group.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModChoiceGetChoiceResultsResponse]:
        """Retrieve users results for a given choice.

        Retrieve users results for a given choice.

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param groupid: Group ID. 0 for all participants, empty for active group.
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_get_choice_results_serialize(
            choiceid=choiceid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceGetChoiceResultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_choice_get_choice_results_without_preload_content(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group ID. 0 for all participants, empty for active group.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve users results for a given choice.

        Retrieve users results for a given choice.

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param groupid: Group ID. 0 for all participants, empty for active group.
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_get_choice_results_serialize(
            choiceid=choiceid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceGetChoiceResultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_choice_get_choice_results_serialize(
        self,
        choiceid,
        groupid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_choice_get_choice_results'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_choice_get_choice_results'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_choice_get_choice_results',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if choiceid is not None:
            _form_params += parse_form({'choiceid': choiceid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_choice_get_choices_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of choice instances in a provided set of courses,                             if no courses are provided then all the choice instances the user has access to will be returned.

        Returns a list of choice instances in a provided set of courses,                             if no courses are provided then all the choice instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_get_choices_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceGetChoicesByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_choice_get_choices_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModChoiceGetChoicesByCoursesResponse:
        """Returns a list of choice instances in a provided set of courses,                             if no courses are provided then all the choice instances the user has access to will be returned.

        Returns a list of choice instances in a provided set of courses,                             if no courses are provided then all the choice instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_get_choices_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceGetChoicesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_choice_get_choices_by_courses_from_args(
        self,
        args
    ) -> ModChoiceGetChoicesByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceGetChoicesByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_choice_get_choices_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModChoiceGetChoicesByCoursesResponse]:
        """Returns a list of choice instances in a provided set of courses,                             if no courses are provided then all the choice instances the user has access to will be returned.

        Returns a list of choice instances in a provided set of courses,                             if no courses are provided then all the choice instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_get_choices_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceGetChoicesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_choice_get_choices_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of choice instances in a provided set of courses,                             if no courses are provided then all the choice instances the user has access to will be returned.

        Returns a list of choice instances in a provided set of courses,                             if no courses are provided then all the choice instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_get_choices_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceGetChoicesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_choice_get_choices_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_choice_get_choices_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_choice_get_choices_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_choice_get_choices_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_choice_submit_choice_response_args(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        responses: Annotated[List[Optional[StrictInt]], Field(description="Array of response ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Submit responses to a specific choice item.

        Submit responses to a specific choice item.

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param responses: Array of response ids (required)
        :type responses: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_submit_choice_response_serialize(
            choiceid=choiceid,
            responses=responses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceSubmitChoiceResponseResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_choice_submit_choice_response(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        responses: Annotated[List[Optional[StrictInt]], Field(description="Array of response ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModChoiceSubmitChoiceResponseResponse:
        """Submit responses to a specific choice item.

        Submit responses to a specific choice item.

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param responses: Array of response ids (required)
        :type responses: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_submit_choice_response_serialize(
            choiceid=choiceid,
            responses=responses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceSubmitChoiceResponseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_choice_submit_choice_response_from_args(
        self,
        args
    ) -> ModChoiceSubmitChoiceResponseResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceSubmitChoiceResponseResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_choice_submit_choice_response_with_http_info(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        responses: Annotated[List[Optional[StrictInt]], Field(description="Array of response ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModChoiceSubmitChoiceResponseResponse]:
        """Submit responses to a specific choice item.

        Submit responses to a specific choice item.

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param responses: Array of response ids (required)
        :type responses: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_submit_choice_response_serialize(
            choiceid=choiceid,
            responses=responses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceSubmitChoiceResponseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_choice_submit_choice_response_without_preload_content(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        responses: Annotated[List[Optional[StrictInt]], Field(description="Array of response ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Submit responses to a specific choice item.

        Submit responses to a specific choice item.

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param responses: Array of response ids (required)
        :type responses: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_submit_choice_response_serialize(
            choiceid=choiceid,
            responses=responses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceSubmitChoiceResponseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_choice_submit_choice_response_serialize(
        self,
        choiceid,
        responses,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'responses': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_choice_submit_choice_response'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_choice_submit_choice_response'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_choice_submit_choice_response',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if choiceid is not None:
            _form_params += parse_form({'choiceid': choiceid})
        if responses is not None:
            _form_params += parse_form({'responses': responses})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_choice_view_choice_args(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_view_choice_serialize(
            choiceid=choiceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceViewChoiceResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_choice_view_choice(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModChoiceViewChoiceResponse:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_view_choice_serialize(
            choiceid=choiceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceViewChoiceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_choice_view_choice_from_args(
        self,
        args
    ) -> ModChoiceViewChoiceResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceViewChoiceResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_choice_view_choice_with_http_info(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModChoiceViewChoiceResponse]:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_view_choice_serialize(
            choiceid=choiceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceViewChoiceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_choice_view_choice_without_preload_content(
        self,
        choiceid: Annotated[Optional[StrictInt], Field(description="choice instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param choiceid: choice instance id (required)
        :type choiceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_choice_view_choice_serialize(
            choiceid=choiceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModChoiceViewChoiceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_choice_view_choice_serialize(
        self,
        choiceid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_choice_view_choice'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_choice_view_choice'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_choice_view_choice',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if choiceid is not None:
            _form_params += parse_form({'choiceid': choiceid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_data_add_entry_args(
        self,
        data: Annotated[List[ModDataAddEntryParametersDataInner], Field(description="The fields data to be created")],
        databaseid: Annotated[Optional[StrictInt], Field(description="data instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Adds a new entry.

        Adds a new entry.

        :param data: The fields data to be created (required)
        :type data: List[ModDataAddEntryParametersDataInner]
        :param databaseid: data instance id (required)
        :type databaseid: int
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_add_entry_serialize(
            data=data,
            databaseid=databaseid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataAddEntryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_data_add_entry(
        self,
        data: Annotated[List[ModDataAddEntryParametersDataInner], Field(description="The fields data to be created")],
        databaseid: Annotated[Optional[StrictInt], Field(description="data instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModDataAddEntryResponse:
        """Adds a new entry.

        Adds a new entry.

        :param data: The fields data to be created (required)
        :type data: List[ModDataAddEntryParametersDataInner]
        :param databaseid: data instance id (required)
        :type databaseid: int
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_add_entry_serialize(
            data=data,
            databaseid=databaseid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataAddEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_add_entry_from_args(
        self,
        args
    ) -> ModDataAddEntryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataAddEntryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_add_entry_with_http_info(
        self,
        data: Annotated[List[ModDataAddEntryParametersDataInner], Field(description="The fields data to be created")],
        databaseid: Annotated[Optional[StrictInt], Field(description="data instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModDataAddEntryResponse]:
        """Adds a new entry.

        Adds a new entry.

        :param data: The fields data to be created (required)
        :type data: List[ModDataAddEntryParametersDataInner]
        :param databaseid: data instance id (required)
        :type databaseid: int
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_add_entry_serialize(
            data=data,
            databaseid=databaseid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataAddEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_data_add_entry_without_preload_content(
        self,
        data: Annotated[List[ModDataAddEntryParametersDataInner], Field(description="The fields data to be created")],
        databaseid: Annotated[Optional[StrictInt], Field(description="data instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Adds a new entry.

        Adds a new entry.

        :param data: The fields data to be created (required)
        :type data: List[ModDataAddEntryParametersDataInner]
        :param databaseid: data instance id (required)
        :type databaseid: int
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_add_entry_serialize(
            data=data,
            databaseid=databaseid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataAddEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_data_add_entry_serialize(
        self,
        data,
        databaseid,
        groupid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'data': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_data_add_entry'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_data_add_entry'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_data_add_entry',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if data is not None:
            _form_params += parse_form({'data': data})
        if databaseid is not None:
            _form_params += parse_form({'databaseid': databaseid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_data_approve_entry_args(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Record entry id.")],
        approve: Annotated[Optional[StrictBool], Field(description="Whether to approve (true) or unapprove the entry.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Approves or unapproves an entry.

        Approves or unapproves an entry.

        :param entryid: Record entry id. (required)
        :type entryid: int
        :param approve: Whether to approve (true) or unapprove the entry.
        :type approve: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_approve_entry_serialize(
            entryid=entryid,
            approve=approve,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataApproveEntryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_data_approve_entry(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Record entry id.")],
        approve: Annotated[Optional[StrictBool], Field(description="Whether to approve (true) or unapprove the entry.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModDataApproveEntryResponse:
        """Approves or unapproves an entry.

        Approves or unapproves an entry.

        :param entryid: Record entry id. (required)
        :type entryid: int
        :param approve: Whether to approve (true) or unapprove the entry.
        :type approve: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_approve_entry_serialize(
            entryid=entryid,
            approve=approve,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataApproveEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_approve_entry_from_args(
        self,
        args
    ) -> ModDataApproveEntryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataApproveEntryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_approve_entry_with_http_info(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Record entry id.")],
        approve: Annotated[Optional[StrictBool], Field(description="Whether to approve (true) or unapprove the entry.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModDataApproveEntryResponse]:
        """Approves or unapproves an entry.

        Approves or unapproves an entry.

        :param entryid: Record entry id. (required)
        :type entryid: int
        :param approve: Whether to approve (true) or unapprove the entry.
        :type approve: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_approve_entry_serialize(
            entryid=entryid,
            approve=approve,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataApproveEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_data_approve_entry_without_preload_content(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Record entry id.")],
        approve: Annotated[Optional[StrictBool], Field(description="Whether to approve (true) or unapprove the entry.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Approves or unapproves an entry.

        Approves or unapproves an entry.

        :param entryid: Record entry id. (required)
        :type entryid: int
        :param approve: Whether to approve (true) or unapprove the entry.
        :type approve: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_approve_entry_serialize(
            entryid=entryid,
            approve=approve,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataApproveEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_data_approve_entry_serialize(
        self,
        entryid,
        approve,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_data_approve_entry'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_data_approve_entry'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_data_approve_entry',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if approve is not None:
            _form_params += parse_form({'approve': approve})
        if entryid is not None:
            _form_params += parse_form({'entryid': entryid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_data_delete_entry_args(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Record entry id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes an entry.

        Deletes an entry.

        :param entryid: Record entry id. (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_delete_entry_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataDeleteEntryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_data_delete_entry(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Record entry id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModDataDeleteEntryResponse:
        """Deletes an entry.

        Deletes an entry.

        :param entryid: Record entry id. (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_delete_entry_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataDeleteEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_delete_entry_from_args(
        self,
        args
    ) -> ModDataDeleteEntryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataDeleteEntryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_delete_entry_with_http_info(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Record entry id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModDataDeleteEntryResponse]:
        """Deletes an entry.

        Deletes an entry.

        :param entryid: Record entry id. (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_delete_entry_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataDeleteEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_data_delete_entry_without_preload_content(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Record entry id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes an entry.

        Deletes an entry.

        :param entryid: Record entry id. (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_delete_entry_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataDeleteEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_data_delete_entry_serialize(
        self,
        entryid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_data_delete_entry'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_data_delete_entry'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_data_delete_entry',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if entryid is not None:
            _form_params += parse_form({'entryid': entryid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_data_delete_saved_preset_args(
        self,
        dataid: Annotated[Optional[StrictInt], Field(description="Id of the data activity")],
        presetnames: List[Optional[StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete site user preset.

        Delete site user preset.

        :param dataid: Id of the data activity (required)
        :type dataid: int
        :param presetnames: (required)
        :type presetnames: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_delete_saved_preset_serialize(
            dataid=dataid,
            presetnames=presetnames,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataDeleteSavedPresetResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_data_delete_saved_preset(
        self,
        dataid: Annotated[Optional[StrictInt], Field(description="Id of the data activity")],
        presetnames: List[Optional[StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModDataDeleteSavedPresetResponse:
        """Delete site user preset.

        Delete site user preset.

        :param dataid: Id of the data activity (required)
        :type dataid: int
        :param presetnames: (required)
        :type presetnames: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_delete_saved_preset_serialize(
            dataid=dataid,
            presetnames=presetnames,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataDeleteSavedPresetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_delete_saved_preset_from_args(
        self,
        args
    ) -> ModDataDeleteSavedPresetResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataDeleteSavedPresetResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_delete_saved_preset_with_http_info(
        self,
        dataid: Annotated[Optional[StrictInt], Field(description="Id of the data activity")],
        presetnames: List[Optional[StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModDataDeleteSavedPresetResponse]:
        """Delete site user preset.

        Delete site user preset.

        :param dataid: Id of the data activity (required)
        :type dataid: int
        :param presetnames: (required)
        :type presetnames: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_delete_saved_preset_serialize(
            dataid=dataid,
            presetnames=presetnames,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataDeleteSavedPresetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_data_delete_saved_preset_without_preload_content(
        self,
        dataid: Annotated[Optional[StrictInt], Field(description="Id of the data activity")],
        presetnames: List[Optional[StrictStr]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete site user preset.

        Delete site user preset.

        :param dataid: Id of the data activity (required)
        :type dataid: int
        :param presetnames: (required)
        :type presetnames: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_delete_saved_preset_serialize(
            dataid=dataid,
            presetnames=presetnames,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataDeleteSavedPresetResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_data_delete_saved_preset_serialize(
        self,
        dataid,
        presetnames,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'presetnames': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_data_delete_saved_preset'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_data_delete_saved_preset'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_data_delete_saved_preset',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if dataid is not None:
            _form_params += parse_form({'dataid': dataid})
        if presetnames is not None:
            _form_params += parse_form({'presetnames': presetnames})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_data_get_data_access_information_args(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="Database instance id.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return access information for a given database.

        Return access information for a given database.

        :param databaseid: Database instance id. (required)
        :type databaseid: int
        :param groupid: Group id, 0 means that the function will determine the user group.
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_data_access_information_serialize(
            databaseid=databaseid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetDataAccessInformationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_data_get_data_access_information(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="Database instance id.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModDataGetDataAccessInformationResponse:
        """Return access information for a given database.

        Return access information for a given database.

        :param databaseid: Database instance id. (required)
        :type databaseid: int
        :param groupid: Group id, 0 means that the function will determine the user group.
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_data_access_information_serialize(
            databaseid=databaseid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetDataAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_get_data_access_information_from_args(
        self,
        args
    ) -> ModDataGetDataAccessInformationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetDataAccessInformationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_get_data_access_information_with_http_info(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="Database instance id.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModDataGetDataAccessInformationResponse]:
        """Return access information for a given database.

        Return access information for a given database.

        :param databaseid: Database instance id. (required)
        :type databaseid: int
        :param groupid: Group id, 0 means that the function will determine the user group.
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_data_access_information_serialize(
            databaseid=databaseid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetDataAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_data_get_data_access_information_without_preload_content(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="Database instance id.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return access information for a given database.

        Return access information for a given database.

        :param databaseid: Database instance id. (required)
        :type databaseid: int
        :param groupid: Group id, 0 means that the function will determine the user group.
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_data_access_information_serialize(
            databaseid=databaseid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetDataAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_data_get_data_access_information_serialize(
        self,
        databaseid,
        groupid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_data_get_data_access_information'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_data_get_data_access_information'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_data_get_data_access_information',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if databaseid is not None:
            _form_params += parse_form({'databaseid': databaseid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_data_get_databases_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of database instances in a provided set of courses, if             no courses are provided then all the database instances the user has access to will be returned.

        Returns a list of database instances in a provided set of courses, if             no courses are provided then all the database instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_databases_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetDatabasesByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_data_get_databases_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModDataGetDatabasesByCoursesResponse:
        """Returns a list of database instances in a provided set of courses, if             no courses are provided then all the database instances the user has access to will be returned.

        Returns a list of database instances in a provided set of courses, if             no courses are provided then all the database instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_databases_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetDatabasesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_get_databases_by_courses_from_args(
        self,
        args
    ) -> ModDataGetDatabasesByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetDatabasesByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_get_databases_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModDataGetDatabasesByCoursesResponse]:
        """Returns a list of database instances in a provided set of courses, if             no courses are provided then all the database instances the user has access to will be returned.

        Returns a list of database instances in a provided set of courses, if             no courses are provided then all the database instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_databases_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetDatabasesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_data_get_databases_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of database instances in a provided set of courses, if             no courses are provided then all the database instances the user has access to will be returned.

        Returns a list of database instances in a provided set of courses, if             no courses are provided then all the database instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_databases_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetDatabasesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_data_get_databases_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_data_get_databases_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_data_get_databases_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_data_get_databases_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_data_get_entries_args(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="data instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        order: Annotated[Optional[StrictStr], Field(description="The direction of the sorting: 'ASC' or 'DESC'.                                                 Empty for using the default database setting.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page")] = None,
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return contents or not. This will return each entry                                                         raw contents and the complete list view (using the template).")] = None,
        sort: Annotated[Optional[StrictInt], Field(description="Sort the records by this field id, reserved ids are:                                                 0: timeadded                                                 -1: firstname                                                 -2: lastname                                                 -3: approved                                                 -4: timemodified.                                                 Empty for using the default database setting.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the complete list of entries of the given database.

        Return the complete list of entries of the given database.

        :param databaseid: data instance id (required)
        :type databaseid: int
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param order: The direction of the sorting: 'ASC' or 'DESC'.                                                 Empty for using the default database setting.
        :type order: str
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page
        :type perpage: int
        :param returncontents: Whether to return contents or not. This will return each entry                                                         raw contents and the complete list view (using the template).
        :type returncontents: bool
        :param sort: Sort the records by this field id, reserved ids are:                                                 0: timeadded                                                 -1: firstname                                                 -2: lastname                                                 -3: approved                                                 -4: timemodified.                                                 Empty for using the default database setting.
        :type sort: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_entries_serialize(
            databaseid=databaseid,
            groupid=groupid,
            order=order,
            page=page,
            perpage=perpage,
            returncontents=returncontents,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetEntriesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_data_get_entries(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="data instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        order: Annotated[Optional[StrictStr], Field(description="The direction of the sorting: 'ASC' or 'DESC'.                                                 Empty for using the default database setting.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page")] = None,
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return contents or not. This will return each entry                                                         raw contents and the complete list view (using the template).")] = None,
        sort: Annotated[Optional[StrictInt], Field(description="Sort the records by this field id, reserved ids are:                                                 0: timeadded                                                 -1: firstname                                                 -2: lastname                                                 -3: approved                                                 -4: timemodified.                                                 Empty for using the default database setting.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModDataGetEntriesResponse:
        """Return the complete list of entries of the given database.

        Return the complete list of entries of the given database.

        :param databaseid: data instance id (required)
        :type databaseid: int
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param order: The direction of the sorting: 'ASC' or 'DESC'.                                                 Empty for using the default database setting.
        :type order: str
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page
        :type perpage: int
        :param returncontents: Whether to return contents or not. This will return each entry                                                         raw contents and the complete list view (using the template).
        :type returncontents: bool
        :param sort: Sort the records by this field id, reserved ids are:                                                 0: timeadded                                                 -1: firstname                                                 -2: lastname                                                 -3: approved                                                 -4: timemodified.                                                 Empty for using the default database setting.
        :type sort: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_entries_serialize(
            databaseid=databaseid,
            groupid=groupid,
            order=order,
            page=page,
            perpage=perpage,
            returncontents=returncontents,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetEntriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_get_entries_from_args(
        self,
        args
    ) -> ModDataGetEntriesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetEntriesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_get_entries_with_http_info(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="data instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        order: Annotated[Optional[StrictStr], Field(description="The direction of the sorting: 'ASC' or 'DESC'.                                                 Empty for using the default database setting.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page")] = None,
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return contents or not. This will return each entry                                                         raw contents and the complete list view (using the template).")] = None,
        sort: Annotated[Optional[StrictInt], Field(description="Sort the records by this field id, reserved ids are:                                                 0: timeadded                                                 -1: firstname                                                 -2: lastname                                                 -3: approved                                                 -4: timemodified.                                                 Empty for using the default database setting.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModDataGetEntriesResponse]:
        """Return the complete list of entries of the given database.

        Return the complete list of entries of the given database.

        :param databaseid: data instance id (required)
        :type databaseid: int
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param order: The direction of the sorting: 'ASC' or 'DESC'.                                                 Empty for using the default database setting.
        :type order: str
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page
        :type perpage: int
        :param returncontents: Whether to return contents or not. This will return each entry                                                         raw contents and the complete list view (using the template).
        :type returncontents: bool
        :param sort: Sort the records by this field id, reserved ids are:                                                 0: timeadded                                                 -1: firstname                                                 -2: lastname                                                 -3: approved                                                 -4: timemodified.                                                 Empty for using the default database setting.
        :type sort: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_entries_serialize(
            databaseid=databaseid,
            groupid=groupid,
            order=order,
            page=page,
            perpage=perpage,
            returncontents=returncontents,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetEntriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_data_get_entries_without_preload_content(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="data instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        order: Annotated[Optional[StrictStr], Field(description="The direction of the sorting: 'ASC' or 'DESC'.                                                 Empty for using the default database setting.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page")] = None,
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return contents or not. This will return each entry                                                         raw contents and the complete list view (using the template).")] = None,
        sort: Annotated[Optional[StrictInt], Field(description="Sort the records by this field id, reserved ids are:                                                 0: timeadded                                                 -1: firstname                                                 -2: lastname                                                 -3: approved                                                 -4: timemodified.                                                 Empty for using the default database setting.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the complete list of entries of the given database.

        Return the complete list of entries of the given database.

        :param databaseid: data instance id (required)
        :type databaseid: int
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param order: The direction of the sorting: 'ASC' or 'DESC'.                                                 Empty for using the default database setting.
        :type order: str
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page
        :type perpage: int
        :param returncontents: Whether to return contents or not. This will return each entry                                                         raw contents and the complete list view (using the template).
        :type returncontents: bool
        :param sort: Sort the records by this field id, reserved ids are:                                                 0: timeadded                                                 -1: firstname                                                 -2: lastname                                                 -3: approved                                                 -4: timemodified.                                                 Empty for using the default database setting.
        :type sort: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_entries_serialize(
            databaseid=databaseid,
            groupid=groupid,
            order=order,
            page=page,
            perpage=perpage,
            returncontents=returncontents,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetEntriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_data_get_entries_serialize(
        self,
        databaseid,
        groupid,
        order,
        page,
        perpage,
        returncontents,
        sort,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_data_get_entries'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_data_get_entries'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_data_get_entries',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if databaseid is not None:
            _form_params += parse_form({'databaseid': databaseid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if order is not None:
            _form_params += parse_form({'order': order})
        if page is not None:
            _form_params += parse_form({'page': page})
        if perpage is not None:
            _form_params += parse_form({'perpage': perpage})
        if returncontents is not None:
            _form_params += parse_form({'returncontents': returncontents})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_data_get_entry_args(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="record entry id")],
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return contents or not.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return one entry record from the database, including contents optionally.

        Return one entry record from the database, including contents optionally.

        :param entryid: record entry id (required)
        :type entryid: int
        :param returncontents: Whether to return contents or not.
        :type returncontents: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_entry_serialize(
            entryid=entryid,
            returncontents=returncontents,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetEntryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_data_get_entry(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="record entry id")],
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return contents or not.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModDataGetEntryResponse:
        """Return one entry record from the database, including contents optionally.

        Return one entry record from the database, including contents optionally.

        :param entryid: record entry id (required)
        :type entryid: int
        :param returncontents: Whether to return contents or not.
        :type returncontents: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_entry_serialize(
            entryid=entryid,
            returncontents=returncontents,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_get_entry_from_args(
        self,
        args
    ) -> ModDataGetEntryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetEntryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_get_entry_with_http_info(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="record entry id")],
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return contents or not.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModDataGetEntryResponse]:
        """Return one entry record from the database, including contents optionally.

        Return one entry record from the database, including contents optionally.

        :param entryid: record entry id (required)
        :type entryid: int
        :param returncontents: Whether to return contents or not.
        :type returncontents: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_entry_serialize(
            entryid=entryid,
            returncontents=returncontents,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_data_get_entry_without_preload_content(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="record entry id")],
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return contents or not.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return one entry record from the database, including contents optionally.

        Return one entry record from the database, including contents optionally.

        :param entryid: record entry id (required)
        :type entryid: int
        :param returncontents: Whether to return contents or not.
        :type returncontents: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_entry_serialize(
            entryid=entryid,
            returncontents=returncontents,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_data_get_entry_serialize(
        self,
        entryid,
        returncontents,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_data_get_entry'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_data_get_entry'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_data_get_entry',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if entryid is not None:
            _form_params += parse_form({'entryid': entryid})
        if returncontents is not None:
            _form_params += parse_form({'returncontents': returncontents})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_data_get_fields_args(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="Database instance id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the list of configured fields for the given database.

        Return the list of configured fields for the given database.

        :param databaseid: Database instance id. (required)
        :type databaseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_fields_serialize(
            databaseid=databaseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetFieldsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_data_get_fields(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="Database instance id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModDataGetFieldsResponse:
        """Return the list of configured fields for the given database.

        Return the list of configured fields for the given database.

        :param databaseid: Database instance id. (required)
        :type databaseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_fields_serialize(
            databaseid=databaseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetFieldsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_get_fields_from_args(
        self,
        args
    ) -> ModDataGetFieldsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetFieldsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_get_fields_with_http_info(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="Database instance id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModDataGetFieldsResponse]:
        """Return the list of configured fields for the given database.

        Return the list of configured fields for the given database.

        :param databaseid: Database instance id. (required)
        :type databaseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_fields_serialize(
            databaseid=databaseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetFieldsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_data_get_fields_without_preload_content(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="Database instance id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the list of configured fields for the given database.

        Return the list of configured fields for the given database.

        :param databaseid: Database instance id. (required)
        :type databaseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_fields_serialize(
            databaseid=databaseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetFieldsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_data_get_fields_serialize(
        self,
        databaseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_data_get_fields'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_data_get_fields'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_data_get_fields',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if databaseid is not None:
            _form_params += parse_form({'databaseid': databaseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_data_get_mapping_information_args(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="Id of the data activity")],
        importedpreset: Annotated[Optional[StrictStr], Field(description="Preset to be imported")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get importing information

        Get importing information

        :param cmid: Id of the data activity (required)
        :type cmid: int
        :param importedpreset: Preset to be imported (required)
        :type importedpreset: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_mapping_information_serialize(
            cmid=cmid,
            importedpreset=importedpreset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetMappingInformationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_data_get_mapping_information(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="Id of the data activity")],
        importedpreset: Annotated[Optional[StrictStr], Field(description="Preset to be imported")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModDataGetMappingInformationResponse:
        """Get importing information

        Get importing information

        :param cmid: Id of the data activity (required)
        :type cmid: int
        :param importedpreset: Preset to be imported (required)
        :type importedpreset: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_mapping_information_serialize(
            cmid=cmid,
            importedpreset=importedpreset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetMappingInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_get_mapping_information_from_args(
        self,
        args
    ) -> ModDataGetMappingInformationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetMappingInformationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_get_mapping_information_with_http_info(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="Id of the data activity")],
        importedpreset: Annotated[Optional[StrictStr], Field(description="Preset to be imported")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModDataGetMappingInformationResponse]:
        """Get importing information

        Get importing information

        :param cmid: Id of the data activity (required)
        :type cmid: int
        :param importedpreset: Preset to be imported (required)
        :type importedpreset: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_mapping_information_serialize(
            cmid=cmid,
            importedpreset=importedpreset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetMappingInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_data_get_mapping_information_without_preload_content(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="Id of the data activity")],
        importedpreset: Annotated[Optional[StrictStr], Field(description="Preset to be imported")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get importing information

        Get importing information

        :param cmid: Id of the data activity (required)
        :type cmid: int
        :param importedpreset: Preset to be imported (required)
        :type importedpreset: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_get_mapping_information_serialize(
            cmid=cmid,
            importedpreset=importedpreset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataGetMappingInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_data_get_mapping_information_serialize(
        self,
        cmid,
        importedpreset,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_data_get_mapping_information'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_data_get_mapping_information'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_data_get_mapping_information',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        if importedpreset is not None:
            _form_params += parse_form({'importedpreset': importedpreset})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_data_search_entries_args(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="data instance id")],
        advsearch: Annotated[Optional[List[ModDataSearchEntriesParametersAdvsearchInner]], Field(description="Advanced search")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        order: Annotated[Optional[StrictStr], Field(description="The direction of the sorting: 'ASC' or 'DESC'.                                                 Empty for using the default database setting.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page")] = None,
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return contents or not.")] = None,
        search: Annotated[Optional[StrictStr], Field(description="search string (empty when using advanced)")] = None,
        sort: Annotated[Optional[StrictInt], Field(description="Sort the records by this field id, reserved ids are:                                                 0: timeadded                                                 -1: firstname                                                 -2: lastname                                                 -3: approved                                                 -4: timemodified.                                                 Empty for using the default database setting.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Search for entries in the given database.

        Search for entries in the given database.

        :param databaseid: data instance id (required)
        :type databaseid: int
        :param advsearch: Advanced search
        :type advsearch: List[ModDataSearchEntriesParametersAdvsearchInner]
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param order: The direction of the sorting: 'ASC' or 'DESC'.                                                 Empty for using the default database setting.
        :type order: str
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page
        :type perpage: int
        :param returncontents: Whether to return contents or not.
        :type returncontents: bool
        :param search: search string (empty when using advanced)
        :type search: str
        :param sort: Sort the records by this field id, reserved ids are:                                                 0: timeadded                                                 -1: firstname                                                 -2: lastname                                                 -3: approved                                                 -4: timemodified.                                                 Empty for using the default database setting.
        :type sort: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_search_entries_serialize(
            databaseid=databaseid,
            advsearch=advsearch,
            groupid=groupid,
            order=order,
            page=page,
            perpage=perpage,
            returncontents=returncontents,
            search=search,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataSearchEntriesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_data_search_entries(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="data instance id")],
        advsearch: Annotated[Optional[List[ModDataSearchEntriesParametersAdvsearchInner]], Field(description="Advanced search")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        order: Annotated[Optional[StrictStr], Field(description="The direction of the sorting: 'ASC' or 'DESC'.                                                 Empty for using the default database setting.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page")] = None,
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return contents or not.")] = None,
        search: Annotated[Optional[StrictStr], Field(description="search string (empty when using advanced)")] = None,
        sort: Annotated[Optional[StrictInt], Field(description="Sort the records by this field id, reserved ids are:                                                 0: timeadded                                                 -1: firstname                                                 -2: lastname                                                 -3: approved                                                 -4: timemodified.                                                 Empty for using the default database setting.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModDataSearchEntriesResponse:
        """Search for entries in the given database.

        Search for entries in the given database.

        :param databaseid: data instance id (required)
        :type databaseid: int
        :param advsearch: Advanced search
        :type advsearch: List[ModDataSearchEntriesParametersAdvsearchInner]
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param order: The direction of the sorting: 'ASC' or 'DESC'.                                                 Empty for using the default database setting.
        :type order: str
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page
        :type perpage: int
        :param returncontents: Whether to return contents or not.
        :type returncontents: bool
        :param search: search string (empty when using advanced)
        :type search: str
        :param sort: Sort the records by this field id, reserved ids are:                                                 0: timeadded                                                 -1: firstname                                                 -2: lastname                                                 -3: approved                                                 -4: timemodified.                                                 Empty for using the default database setting.
        :type sort: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_search_entries_serialize(
            databaseid=databaseid,
            advsearch=advsearch,
            groupid=groupid,
            order=order,
            page=page,
            perpage=perpage,
            returncontents=returncontents,
            search=search,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataSearchEntriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_search_entries_from_args(
        self,
        args
    ) -> ModDataSearchEntriesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataSearchEntriesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_search_entries_with_http_info(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="data instance id")],
        advsearch: Annotated[Optional[List[ModDataSearchEntriesParametersAdvsearchInner]], Field(description="Advanced search")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        order: Annotated[Optional[StrictStr], Field(description="The direction of the sorting: 'ASC' or 'DESC'.                                                 Empty for using the default database setting.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page")] = None,
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return contents or not.")] = None,
        search: Annotated[Optional[StrictStr], Field(description="search string (empty when using advanced)")] = None,
        sort: Annotated[Optional[StrictInt], Field(description="Sort the records by this field id, reserved ids are:                                                 0: timeadded                                                 -1: firstname                                                 -2: lastname                                                 -3: approved                                                 -4: timemodified.                                                 Empty for using the default database setting.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModDataSearchEntriesResponse]:
        """Search for entries in the given database.

        Search for entries in the given database.

        :param databaseid: data instance id (required)
        :type databaseid: int
        :param advsearch: Advanced search
        :type advsearch: List[ModDataSearchEntriesParametersAdvsearchInner]
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param order: The direction of the sorting: 'ASC' or 'DESC'.                                                 Empty for using the default database setting.
        :type order: str
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page
        :type perpage: int
        :param returncontents: Whether to return contents or not.
        :type returncontents: bool
        :param search: search string (empty when using advanced)
        :type search: str
        :param sort: Sort the records by this field id, reserved ids are:                                                 0: timeadded                                                 -1: firstname                                                 -2: lastname                                                 -3: approved                                                 -4: timemodified.                                                 Empty for using the default database setting.
        :type sort: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_search_entries_serialize(
            databaseid=databaseid,
            advsearch=advsearch,
            groupid=groupid,
            order=order,
            page=page,
            perpage=perpage,
            returncontents=returncontents,
            search=search,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataSearchEntriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_data_search_entries_without_preload_content(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="data instance id")],
        advsearch: Annotated[Optional[List[ModDataSearchEntriesParametersAdvsearchInner]], Field(description="Advanced search")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        order: Annotated[Optional[StrictStr], Field(description="The direction of the sorting: 'ASC' or 'DESC'.                                                 Empty for using the default database setting.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page")] = None,
        returncontents: Annotated[Optional[StrictBool], Field(description="Whether to return contents or not.")] = None,
        search: Annotated[Optional[StrictStr], Field(description="search string (empty when using advanced)")] = None,
        sort: Annotated[Optional[StrictInt], Field(description="Sort the records by this field id, reserved ids are:                                                 0: timeadded                                                 -1: firstname                                                 -2: lastname                                                 -3: approved                                                 -4: timemodified.                                                 Empty for using the default database setting.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Search for entries in the given database.

        Search for entries in the given database.

        :param databaseid: data instance id (required)
        :type databaseid: int
        :param advsearch: Advanced search
        :type advsearch: List[ModDataSearchEntriesParametersAdvsearchInner]
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param order: The direction of the sorting: 'ASC' or 'DESC'.                                                 Empty for using the default database setting.
        :type order: str
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page
        :type perpage: int
        :param returncontents: Whether to return contents or not.
        :type returncontents: bool
        :param search: search string (empty when using advanced)
        :type search: str
        :param sort: Sort the records by this field id, reserved ids are:                                                 0: timeadded                                                 -1: firstname                                                 -2: lastname                                                 -3: approved                                                 -4: timemodified.                                                 Empty for using the default database setting.
        :type sort: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_search_entries_serialize(
            databaseid=databaseid,
            advsearch=advsearch,
            groupid=groupid,
            order=order,
            page=page,
            perpage=perpage,
            returncontents=returncontents,
            search=search,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataSearchEntriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_data_search_entries_serialize(
        self,
        databaseid,
        advsearch,
        groupid,
        order,
        page,
        perpage,
        returncontents,
        search,
        sort,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'advsearch': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_data_search_entries'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_data_search_entries'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_data_search_entries',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if advsearch is not None:
            _form_params += parse_form({'advsearch': advsearch})
        if databaseid is not None:
            _form_params += parse_form({'databaseid': databaseid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if order is not None:
            _form_params += parse_form({'order': order})
        if page is not None:
            _form_params += parse_form({'page': page})
        if perpage is not None:
            _form_params += parse_form({'perpage': perpage})
        if returncontents is not None:
            _form_params += parse_form({'returncontents': returncontents})
        if search is not None:
            _form_params += parse_form({'search': search})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_data_update_entry_args(
        self,
        data: Annotated[List[ModDataUpdateEntryParametersDataInner], Field(description="The fields data to be updated")],
        entryid: Annotated[Optional[StrictInt], Field(description="The entry record id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Updates an existing entry.

        Updates an existing entry.

        :param data: The fields data to be updated (required)
        :type data: List[ModDataUpdateEntryParametersDataInner]
        :param entryid: The entry record id. (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_update_entry_serialize(
            data=data,
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataUpdateEntryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_data_update_entry(
        self,
        data: Annotated[List[ModDataUpdateEntryParametersDataInner], Field(description="The fields data to be updated")],
        entryid: Annotated[Optional[StrictInt], Field(description="The entry record id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModDataUpdateEntryResponse:
        """Updates an existing entry.

        Updates an existing entry.

        :param data: The fields data to be updated (required)
        :type data: List[ModDataUpdateEntryParametersDataInner]
        :param entryid: The entry record id. (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_update_entry_serialize(
            data=data,
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataUpdateEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_update_entry_from_args(
        self,
        args
    ) -> ModDataUpdateEntryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataUpdateEntryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_update_entry_with_http_info(
        self,
        data: Annotated[List[ModDataUpdateEntryParametersDataInner], Field(description="The fields data to be updated")],
        entryid: Annotated[Optional[StrictInt], Field(description="The entry record id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModDataUpdateEntryResponse]:
        """Updates an existing entry.

        Updates an existing entry.

        :param data: The fields data to be updated (required)
        :type data: List[ModDataUpdateEntryParametersDataInner]
        :param entryid: The entry record id. (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_update_entry_serialize(
            data=data,
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataUpdateEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_data_update_entry_without_preload_content(
        self,
        data: Annotated[List[ModDataUpdateEntryParametersDataInner], Field(description="The fields data to be updated")],
        entryid: Annotated[Optional[StrictInt], Field(description="The entry record id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Updates an existing entry.

        Updates an existing entry.

        :param data: The fields data to be updated (required)
        :type data: List[ModDataUpdateEntryParametersDataInner]
        :param entryid: The entry record id. (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_update_entry_serialize(
            data=data,
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataUpdateEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_data_update_entry_serialize(
        self,
        data,
        entryid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'data': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_data_update_entry'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_data_update_entry'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_data_update_entry',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if data is not None:
            _form_params += parse_form({'data': data})
        if entryid is not None:
            _form_params += parse_form({'entryid': entryid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_data_view_database_args(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="data instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Simulate the view.php web interface data: trigger events, completion, etc...

        Simulate the view.php web interface data: trigger events, completion, etc...

        :param databaseid: data instance id (required)
        :type databaseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_view_database_serialize(
            databaseid=databaseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataViewDatabaseResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_data_view_database(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="data instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModDataViewDatabaseResponse:
        """Simulate the view.php web interface data: trigger events, completion, etc...

        Simulate the view.php web interface data: trigger events, completion, etc...

        :param databaseid: data instance id (required)
        :type databaseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_view_database_serialize(
            databaseid=databaseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataViewDatabaseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_view_database_from_args(
        self,
        args
    ) -> ModDataViewDatabaseResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataViewDatabaseResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_data_view_database_with_http_info(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="data instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModDataViewDatabaseResponse]:
        """Simulate the view.php web interface data: trigger events, completion, etc...

        Simulate the view.php web interface data: trigger events, completion, etc...

        :param databaseid: data instance id (required)
        :type databaseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_view_database_serialize(
            databaseid=databaseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataViewDatabaseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_data_view_database_without_preload_content(
        self,
        databaseid: Annotated[Optional[StrictInt], Field(description="data instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Simulate the view.php web interface data: trigger events, completion, etc...

        Simulate the view.php web interface data: trigger events, completion, etc...

        :param databaseid: data instance id (required)
        :type databaseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_data_view_database_serialize(
            databaseid=databaseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModDataViewDatabaseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_data_view_database_serialize(
        self,
        databaseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_data_view_database'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_data_view_database'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_data_view_database',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if databaseid is not None:
            _form_params += parse_form({'databaseid': databaseid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_feedback_get_analysis_args(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves the feedback analysis.

        Retrieves the feedback analysis.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_analysis_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetAnalysisResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_feedback_get_analysis(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModFeedbackGetAnalysisResponse:
        """Retrieves the feedback analysis.

        Retrieves the feedback analysis.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_analysis_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetAnalysisResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_analysis_from_args(
        self,
        args
    ) -> ModFeedbackGetAnalysisResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetAnalysisResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_analysis_with_http_info(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModFeedbackGetAnalysisResponse]:
        """Retrieves the feedback analysis.

        Retrieves the feedback analysis.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_analysis_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetAnalysisResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_feedback_get_analysis_without_preload_content(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves the feedback analysis.

        Retrieves the feedback analysis.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_analysis_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetAnalysisResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_feedback_get_analysis_serialize(
        self,
        feedbackid,
        courseid,
        groupid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_feedback_get_analysis'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_feedback_get_analysis'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_feedback_get_analysis',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if feedbackid is not None:
            _form_params += parse_form({'feedbackid': feedbackid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_feedback_get_current_completed_tmp_args(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the temporary completion record for the current user.

        Returns the temporary completion record for the current user.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_current_completed_tmp_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetCurrentCompletedTmpResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_feedback_get_current_completed_tmp(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModFeedbackGetCurrentCompletedTmpResponse:
        """Returns the temporary completion record for the current user.

        Returns the temporary completion record for the current user.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_current_completed_tmp_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetCurrentCompletedTmpResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_current_completed_tmp_from_args(
        self,
        args
    ) -> ModFeedbackGetCurrentCompletedTmpResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetCurrentCompletedTmpResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_current_completed_tmp_with_http_info(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModFeedbackGetCurrentCompletedTmpResponse]:
        """Returns the temporary completion record for the current user.

        Returns the temporary completion record for the current user.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_current_completed_tmp_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetCurrentCompletedTmpResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_feedback_get_current_completed_tmp_without_preload_content(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the temporary completion record for the current user.

        Returns the temporary completion record for the current user.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_current_completed_tmp_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetCurrentCompletedTmpResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_feedback_get_current_completed_tmp_serialize(
        self,
        feedbackid,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_feedback_get_current_completed_tmp'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_feedback_get_current_completed_tmp'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_feedback_get_current_completed_tmp',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if feedbackid is not None:
            _form_params += parse_form({'feedbackid': feedbackid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_feedback_get_feedback_access_information_args(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id.")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return access information for a given feedback.

        Return access information for a given feedback.

        :param feedbackid: Feedback instance id. (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_feedback_access_information_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetFeedbackAccessInformationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_feedback_get_feedback_access_information(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id.")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModFeedbackGetFeedbackAccessInformationResponse:
        """Return access information for a given feedback.

        Return access information for a given feedback.

        :param feedbackid: Feedback instance id. (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_feedback_access_information_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetFeedbackAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_feedback_access_information_from_args(
        self,
        args
    ) -> ModFeedbackGetFeedbackAccessInformationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetFeedbackAccessInformationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_feedback_access_information_with_http_info(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id.")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModFeedbackGetFeedbackAccessInformationResponse]:
        """Return access information for a given feedback.

        Return access information for a given feedback.

        :param feedbackid: Feedback instance id. (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_feedback_access_information_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetFeedbackAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_feedback_get_feedback_access_information_without_preload_content(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id.")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return access information for a given feedback.

        Return access information for a given feedback.

        :param feedbackid: Feedback instance id. (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_feedback_access_information_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetFeedbackAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_feedback_get_feedback_access_information_serialize(
        self,
        feedbackid,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_feedback_get_feedback_access_information'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_feedback_get_feedback_access_information'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_feedback_get_feedback_access_information',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if feedbackid is not None:
            _form_params += parse_form({'feedbackid': feedbackid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_feedback_get_feedbacks_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of feedbacks in a provided list of courses, if no list is provided all feedbacks that                             the user can view will be returned.

        Returns a list of feedbacks in a provided list of courses, if no list is provided all feedbacks that                             the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_feedbacks_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetFeedbacksByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_feedback_get_feedbacks_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModFeedbackGetFeedbacksByCoursesResponse:
        """Returns a list of feedbacks in a provided list of courses, if no list is provided all feedbacks that                             the user can view will be returned.

        Returns a list of feedbacks in a provided list of courses, if no list is provided all feedbacks that                             the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_feedbacks_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetFeedbacksByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_feedbacks_by_courses_from_args(
        self,
        args
    ) -> ModFeedbackGetFeedbacksByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetFeedbacksByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_feedbacks_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModFeedbackGetFeedbacksByCoursesResponse]:
        """Returns a list of feedbacks in a provided list of courses, if no list is provided all feedbacks that                             the user can view will be returned.

        Returns a list of feedbacks in a provided list of courses, if no list is provided all feedbacks that                             the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_feedbacks_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetFeedbacksByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_feedback_get_feedbacks_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of feedbacks in a provided list of courses, if no list is provided all feedbacks that                             the user can view will be returned.

        Returns a list of feedbacks in a provided list of courses, if no list is provided all feedbacks that                             the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_feedbacks_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetFeedbacksByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_feedback_get_feedbacks_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_feedback_get_feedbacks_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_feedback_get_feedbacks_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_feedback_get_feedbacks_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_feedback_get_finished_responses_args(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id.")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves responses from the last finished attempt.

        Retrieves responses from the last finished attempt.

        :param feedbackid: Feedback instance id. (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_finished_responses_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetFinishedResponsesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_feedback_get_finished_responses(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id.")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModFeedbackGetFinishedResponsesResponse:
        """Retrieves responses from the last finished attempt.

        Retrieves responses from the last finished attempt.

        :param feedbackid: Feedback instance id. (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_finished_responses_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetFinishedResponsesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_finished_responses_from_args(
        self,
        args
    ) -> ModFeedbackGetFinishedResponsesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetFinishedResponsesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_finished_responses_with_http_info(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id.")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModFeedbackGetFinishedResponsesResponse]:
        """Retrieves responses from the last finished attempt.

        Retrieves responses from the last finished attempt.

        :param feedbackid: Feedback instance id. (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_finished_responses_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetFinishedResponsesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_feedback_get_finished_responses_without_preload_content(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id.")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves responses from the last finished attempt.

        Retrieves responses from the last finished attempt.

        :param feedbackid: Feedback instance id. (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_finished_responses_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetFinishedResponsesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_feedback_get_finished_responses_serialize(
        self,
        feedbackid,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_feedback_get_finished_responses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_feedback_get_finished_responses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_feedback_get_finished_responses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if feedbackid is not None:
            _form_params += parse_form({'feedbackid': feedbackid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_feedback_get_items_args(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the items (questions) in the given feedback.

        Returns the items (questions) in the given feedback.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_items_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetItemsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_feedback_get_items(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModFeedbackGetItemsResponse:
        """Returns the items (questions) in the given feedback.

        Returns the items (questions) in the given feedback.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_items_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetItemsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_items_from_args(
        self,
        args
    ) -> ModFeedbackGetItemsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetItemsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_items_with_http_info(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModFeedbackGetItemsResponse]:
        """Returns the items (questions) in the given feedback.

        Returns the items (questions) in the given feedback.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_items_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetItemsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_feedback_get_items_without_preload_content(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the items (questions) in the given feedback.

        Returns the items (questions) in the given feedback.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_items_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetItemsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_feedback_get_items_serialize(
        self,
        feedbackid,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_feedback_get_items'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_feedback_get_items'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_feedback_get_items',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if feedbackid is not None:
            _form_params += parse_form({'feedbackid': feedbackid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_feedback_get_last_completed_args(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves the last completion record for the current user.

        Retrieves the last completion record for the current user.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_last_completed_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetLastCompletedResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_feedback_get_last_completed(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModFeedbackGetLastCompletedResponse:
        """Retrieves the last completion record for the current user.

        Retrieves the last completion record for the current user.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_last_completed_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetLastCompletedResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_last_completed_from_args(
        self,
        args
    ) -> ModFeedbackGetLastCompletedResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetLastCompletedResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_last_completed_with_http_info(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModFeedbackGetLastCompletedResponse]:
        """Retrieves the last completion record for the current user.

        Retrieves the last completion record for the current user.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_last_completed_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetLastCompletedResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_feedback_get_last_completed_without_preload_content(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves the last completion record for the current user.

        Retrieves the last completion record for the current user.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_last_completed_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetLastCompletedResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_feedback_get_last_completed_serialize(
        self,
        feedbackid,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_feedback_get_last_completed'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_feedback_get_last_completed'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_feedback_get_last_completed',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if feedbackid is not None:
            _form_params += parse_form({'feedbackid': feedbackid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_feedback_get_non_respondents_args(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page.")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort param, must be firstname, lastname or lastaccess (default).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves a list of students who didn't submit the feedback.

        Retrieves a list of students who didn't submit the feedback.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param groupid: Group id, 0 means that the function will determine the user group.
        :type groupid: int
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page.
        :type perpage: int
        :param sort: Sort param, must be firstname, lastname or lastaccess (default).
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_non_respondents_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetNonRespondentsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_feedback_get_non_respondents(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page.")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort param, must be firstname, lastname or lastaccess (default).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModFeedbackGetNonRespondentsResponse:
        """Retrieves a list of students who didn't submit the feedback.

        Retrieves a list of students who didn't submit the feedback.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param groupid: Group id, 0 means that the function will determine the user group.
        :type groupid: int
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page.
        :type perpage: int
        :param sort: Sort param, must be firstname, lastname or lastaccess (default).
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_non_respondents_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetNonRespondentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_non_respondents_from_args(
        self,
        args
    ) -> ModFeedbackGetNonRespondentsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetNonRespondentsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_non_respondents_with_http_info(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page.")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort param, must be firstname, lastname or lastaccess (default).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModFeedbackGetNonRespondentsResponse]:
        """Retrieves a list of students who didn't submit the feedback.

        Retrieves a list of students who didn't submit the feedback.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param groupid: Group id, 0 means that the function will determine the user group.
        :type groupid: int
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page.
        :type perpage: int
        :param sort: Sort param, must be firstname, lastname or lastaccess (default).
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_non_respondents_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetNonRespondentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_feedback_get_non_respondents_without_preload_content(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page.")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="Sort param, must be firstname, lastname or lastaccess (default).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves a list of students who didn't submit the feedback.

        Retrieves a list of students who didn't submit the feedback.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param groupid: Group id, 0 means that the function will determine the user group.
        :type groupid: int
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page.
        :type perpage: int
        :param sort: Sort param, must be firstname, lastname or lastaccess (default).
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_non_respondents_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetNonRespondentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_feedback_get_non_respondents_serialize(
        self,
        feedbackid,
        courseid,
        groupid,
        page,
        perpage,
        sort,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_feedback_get_non_respondents'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_feedback_get_non_respondents'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_feedback_get_non_respondents',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if feedbackid is not None:
            _form_params += parse_form({'feedbackid': feedbackid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if page is not None:
            _form_params += parse_form({'page': page})
        if perpage is not None:
            _form_params += parse_form({'perpage': perpage})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_feedback_get_page_items_args(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        page: Annotated[Optional[StrictInt], Field(description="The page to get starting by 0")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get a single feedback page items.

        Get a single feedback page items.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param page: The page to get starting by 0 (required)
        :type page: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_page_items_serialize(
            feedbackid=feedbackid,
            page=page,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetPageItemsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_feedback_get_page_items(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        page: Annotated[Optional[StrictInt], Field(description="The page to get starting by 0")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModFeedbackGetPageItemsResponse:
        """Get a single feedback page items.

        Get a single feedback page items.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param page: The page to get starting by 0 (required)
        :type page: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_page_items_serialize(
            feedbackid=feedbackid,
            page=page,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetPageItemsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_page_items_from_args(
        self,
        args
    ) -> ModFeedbackGetPageItemsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetPageItemsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_page_items_with_http_info(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        page: Annotated[Optional[StrictInt], Field(description="The page to get starting by 0")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModFeedbackGetPageItemsResponse]:
        """Get a single feedback page items.

        Get a single feedback page items.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param page: The page to get starting by 0 (required)
        :type page: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_page_items_serialize(
            feedbackid=feedbackid,
            page=page,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetPageItemsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_feedback_get_page_items_without_preload_content(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        page: Annotated[Optional[StrictInt], Field(description="The page to get starting by 0")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get a single feedback page items.

        Get a single feedback page items.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param page: The page to get starting by 0 (required)
        :type page: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_page_items_serialize(
            feedbackid=feedbackid,
            page=page,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetPageItemsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_feedback_get_page_items_serialize(
        self,
        feedbackid,
        page,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_feedback_get_page_items'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_feedback_get_page_items'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_feedback_get_page_items',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if feedbackid is not None:
            _form_params += parse_form({'feedbackid': feedbackid})
        if page is not None:
            _form_params += parse_form({'page': page})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_feedback_get_responses_analysis_args(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the feedback user responses analysis.

        Return the feedback user responses analysis.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page
        :type perpage: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_responses_analysis_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetResponsesAnalysisResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_feedback_get_responses_analysis(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModFeedbackGetResponsesAnalysisResponse:
        """Return the feedback user responses analysis.

        Return the feedback user responses analysis.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page
        :type perpage: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_responses_analysis_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetResponsesAnalysisResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_responses_analysis_from_args(
        self,
        args
    ) -> ModFeedbackGetResponsesAnalysisResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetResponsesAnalysisResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_responses_analysis_with_http_info(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModFeedbackGetResponsesAnalysisResponse]:
        """Return the feedback user responses analysis.

        Return the feedback user responses analysis.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page
        :type perpage: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_responses_analysis_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetResponsesAnalysisResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_feedback_get_responses_analysis_without_preload_content(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the feedback user responses analysis.

        Return the feedback user responses analysis.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param groupid: Group id, 0 means that the function will determine the user group
        :type groupid: int
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page
        :type perpage: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_responses_analysis_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetResponsesAnalysisResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_feedback_get_responses_analysis_serialize(
        self,
        feedbackid,
        courseid,
        groupid,
        page,
        perpage,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_feedback_get_responses_analysis'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_feedback_get_responses_analysis'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_feedback_get_responses_analysis',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if feedbackid is not None:
            _form_params += parse_form({'feedbackid': feedbackid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if page is not None:
            _form_params += parse_form({'page': page})
        if perpage is not None:
            _form_params += parse_form({'perpage': perpage})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_feedback_get_unfinished_responses_args(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id.")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves responses from the current unfinished attempt.

        Retrieves responses from the current unfinished attempt.

        :param feedbackid: Feedback instance id. (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_unfinished_responses_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetUnfinishedResponsesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_feedback_get_unfinished_responses(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id.")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModFeedbackGetUnfinishedResponsesResponse:
        """Retrieves responses from the current unfinished attempt.

        Retrieves responses from the current unfinished attempt.

        :param feedbackid: Feedback instance id. (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_unfinished_responses_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetUnfinishedResponsesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_unfinished_responses_from_args(
        self,
        args
    ) -> ModFeedbackGetUnfinishedResponsesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetUnfinishedResponsesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_get_unfinished_responses_with_http_info(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id.")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModFeedbackGetUnfinishedResponsesResponse]:
        """Retrieves responses from the current unfinished attempt.

        Retrieves responses from the current unfinished attempt.

        :param feedbackid: Feedback instance id. (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_unfinished_responses_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetUnfinishedResponsesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_feedback_get_unfinished_responses_without_preload_content(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id.")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves responses from the current unfinished attempt.

        Retrieves responses from the current unfinished attempt.

        :param feedbackid: Feedback instance id. (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_get_unfinished_responses_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackGetUnfinishedResponsesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_feedback_get_unfinished_responses_serialize(
        self,
        feedbackid,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_feedback_get_unfinished_responses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_feedback_get_unfinished_responses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_feedback_get_unfinished_responses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if feedbackid is not None:
            _form_params += parse_form({'feedbackid': feedbackid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_feedback_launch_feedback_args(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Starts or continues a feedback submission.

        Starts or continues a feedback submission.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_launch_feedback_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackLaunchFeedbackResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_feedback_launch_feedback(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModFeedbackLaunchFeedbackResponse:
        """Starts or continues a feedback submission.

        Starts or continues a feedback submission.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_launch_feedback_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackLaunchFeedbackResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_launch_feedback_from_args(
        self,
        args
    ) -> ModFeedbackLaunchFeedbackResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackLaunchFeedbackResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_launch_feedback_with_http_info(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModFeedbackLaunchFeedbackResponse]:
        """Starts or continues a feedback submission.

        Starts or continues a feedback submission.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_launch_feedback_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackLaunchFeedbackResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_feedback_launch_feedback_without_preload_content(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Starts or continues a feedback submission.

        Starts or continues a feedback submission.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_launch_feedback_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackLaunchFeedbackResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_feedback_launch_feedback_serialize(
        self,
        feedbackid,
        courseid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_feedback_launch_feedback'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_feedback_launch_feedback'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_feedback_launch_feedback',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if feedbackid is not None:
            _form_params += parse_form({'feedbackid': feedbackid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_feedback_process_page_args(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id.")],
        page: Annotated[Optional[StrictInt], Field(description="The page being processed.")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        goprevious: Annotated[Optional[StrictBool], Field(description="Whether we want to jump to previous page.")] = None,
        responses: Annotated[Optional[List[ModFeedbackProcessPageParametersResponsesInner]], Field(description="The data to be processed.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Process a jump between pages.

        Process a jump between pages.

        :param feedbackid: Feedback instance id. (required)
        :type feedbackid: int
        :param page: The page being processed. (required)
        :type page: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param goprevious: Whether we want to jump to previous page.
        :type goprevious: bool
        :param responses: The data to be processed.
        :type responses: List[ModFeedbackProcessPageParametersResponsesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_process_page_serialize(
            feedbackid=feedbackid,
            page=page,
            courseid=courseid,
            goprevious=goprevious,
            responses=responses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackProcessPageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_feedback_process_page(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id.")],
        page: Annotated[Optional[StrictInt], Field(description="The page being processed.")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        goprevious: Annotated[Optional[StrictBool], Field(description="Whether we want to jump to previous page.")] = None,
        responses: Annotated[Optional[List[ModFeedbackProcessPageParametersResponsesInner]], Field(description="The data to be processed.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModFeedbackProcessPageResponse:
        """Process a jump between pages.

        Process a jump between pages.

        :param feedbackid: Feedback instance id. (required)
        :type feedbackid: int
        :param page: The page being processed. (required)
        :type page: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param goprevious: Whether we want to jump to previous page.
        :type goprevious: bool
        :param responses: The data to be processed.
        :type responses: List[ModFeedbackProcessPageParametersResponsesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_process_page_serialize(
            feedbackid=feedbackid,
            page=page,
            courseid=courseid,
            goprevious=goprevious,
            responses=responses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackProcessPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_process_page_from_args(
        self,
        args
    ) -> ModFeedbackProcessPageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackProcessPageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_process_page_with_http_info(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id.")],
        page: Annotated[Optional[StrictInt], Field(description="The page being processed.")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        goprevious: Annotated[Optional[StrictBool], Field(description="Whether we want to jump to previous page.")] = None,
        responses: Annotated[Optional[List[ModFeedbackProcessPageParametersResponsesInner]], Field(description="The data to be processed.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModFeedbackProcessPageResponse]:
        """Process a jump between pages.

        Process a jump between pages.

        :param feedbackid: Feedback instance id. (required)
        :type feedbackid: int
        :param page: The page being processed. (required)
        :type page: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param goprevious: Whether we want to jump to previous page.
        :type goprevious: bool
        :param responses: The data to be processed.
        :type responses: List[ModFeedbackProcessPageParametersResponsesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_process_page_serialize(
            feedbackid=feedbackid,
            page=page,
            courseid=courseid,
            goprevious=goprevious,
            responses=responses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackProcessPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_feedback_process_page_without_preload_content(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id.")],
        page: Annotated[Optional[StrictInt], Field(description="The page being processed.")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        goprevious: Annotated[Optional[StrictBool], Field(description="Whether we want to jump to previous page.")] = None,
        responses: Annotated[Optional[List[ModFeedbackProcessPageParametersResponsesInner]], Field(description="The data to be processed.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Process a jump between pages.

        Process a jump between pages.

        :param feedbackid: Feedback instance id. (required)
        :type feedbackid: int
        :param page: The page being processed. (required)
        :type page: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param goprevious: Whether we want to jump to previous page.
        :type goprevious: bool
        :param responses: The data to be processed.
        :type responses: List[ModFeedbackProcessPageParametersResponsesInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_process_page_serialize(
            feedbackid=feedbackid,
            page=page,
            courseid=courseid,
            goprevious=goprevious,
            responses=responses,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackProcessPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_feedback_process_page_serialize(
        self,
        feedbackid,
        page,
        courseid,
        goprevious,
        responses,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'responses': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_feedback_process_page'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_feedback_process_page'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_feedback_process_page',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if feedbackid is not None:
            _form_params += parse_form({'feedbackid': feedbackid})
        if goprevious is not None:
            _form_params += parse_form({'goprevious': goprevious})
        if page is not None:
            _form_params += parse_form({'page': page})
        if responses is not None:
            _form_params += parse_form({'responses': responses})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_feedback_questions_reorder_args(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="Feedback course module id")],
        itemorder: Annotated[Optional[StrictStr], Field(description="Feedback order by sequence of question item ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Saves the new order of the questions in the feedback.

        Saves the new order of the questions in the feedback.

        :param cmid: Feedback course module id (required)
        :type cmid: int
        :param itemorder: Feedback order by sequence of question item ids (required)
        :type itemorder: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_questions_reorder_serialize(
            cmid=cmid,
            itemorder=itemorder,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_feedback_questions_reorder(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="Feedback course module id")],
        itemorder: Annotated[Optional[StrictStr], Field(description="Feedback order by sequence of question item ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Saves the new order of the questions in the feedback.

        Saves the new order of the questions in the feedback.

        :param cmid: Feedback course module id (required)
        :type cmid: int
        :param itemorder: Feedback order by sequence of question item ids (required)
        :type itemorder: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_questions_reorder_serialize(
            cmid=cmid,
            itemorder=itemorder,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_questions_reorder_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_questions_reorder_with_http_info(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="Feedback course module id")],
        itemorder: Annotated[Optional[StrictStr], Field(description="Feedback order by sequence of question item ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Saves the new order of the questions in the feedback.

        Saves the new order of the questions in the feedback.

        :param cmid: Feedback course module id (required)
        :type cmid: int
        :param itemorder: Feedback order by sequence of question item ids (required)
        :type itemorder: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_questions_reorder_serialize(
            cmid=cmid,
            itemorder=itemorder,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_feedback_questions_reorder_without_preload_content(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="Feedback course module id")],
        itemorder: Annotated[Optional[StrictStr], Field(description="Feedback order by sequence of question item ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Saves the new order of the questions in the feedback.

        Saves the new order of the questions in the feedback.

        :param cmid: Feedback course module id (required)
        :type cmid: int
        :param itemorder: Feedback order by sequence of question item ids (required)
        :type itemorder: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_questions_reorder_serialize(
            cmid=cmid,
            itemorder=itemorder,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_feedback_questions_reorder_serialize(
        self,
        cmid,
        itemorder,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_feedback_questions_reorder'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_feedback_questions_reorder'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_feedback_questions_reorder',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        if itemorder is not None:
            _form_params += parse_form({'itemorder': itemorder})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_feedback_view_feedback_args(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        moduleviewed: Annotated[Optional[StrictBool], Field(description="If we need to mark the module as viewed for completion")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param moduleviewed: If we need to mark the module as viewed for completion
        :type moduleviewed: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_view_feedback_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            moduleviewed=moduleviewed,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackViewFeedbackResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_feedback_view_feedback(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        moduleviewed: Annotated[Optional[StrictBool], Field(description="If we need to mark the module as viewed for completion")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModFeedbackViewFeedbackResponse:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param moduleviewed: If we need to mark the module as viewed for completion
        :type moduleviewed: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_view_feedback_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            moduleviewed=moduleviewed,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackViewFeedbackResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_view_feedback_from_args(
        self,
        args
    ) -> ModFeedbackViewFeedbackResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackViewFeedbackResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_feedback_view_feedback_with_http_info(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        moduleviewed: Annotated[Optional[StrictBool], Field(description="If we need to mark the module as viewed for completion")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModFeedbackViewFeedbackResponse]:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param moduleviewed: If we need to mark the module as viewed for completion
        :type moduleviewed: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_view_feedback_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            moduleviewed=moduleviewed,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackViewFeedbackResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_feedback_view_feedback_without_preload_content(
        self,
        feedbackid: Annotated[Optional[StrictInt], Field(description="Feedback instance id")],
        courseid: Annotated[Optional[StrictInt], Field(description="Course where user completes the feedback (for site feedbacks only).")] = None,
        moduleviewed: Annotated[Optional[StrictBool], Field(description="If we need to mark the module as viewed for completion")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param feedbackid: Feedback instance id (required)
        :type feedbackid: int
        :param courseid: Course where user completes the feedback (for site feedbacks only).
        :type courseid: int
        :param moduleviewed: If we need to mark the module as viewed for completion
        :type moduleviewed: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_feedback_view_feedback_serialize(
            feedbackid=feedbackid,
            courseid=courseid,
            moduleviewed=moduleviewed,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFeedbackViewFeedbackResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_feedback_view_feedback_serialize(
        self,
        feedbackid,
        courseid,
        moduleviewed,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_feedback_view_feedback'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_feedback_view_feedback'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_feedback_view_feedback',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if feedbackid is not None:
            _form_params += parse_form({'feedbackid': feedbackid})
        if moduleviewed is not None:
            _form_params += parse_form({'moduleviewed': moduleviewed})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_folder_get_folders_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of folders in a provided list of courses, if no list is provided all folders that                             the user can view will be returned. Please note that this WS is not returning the folder contents.

        Returns a list of folders in a provided list of courses, if no list is provided all folders that                             the user can view will be returned. Please note that this WS is not returning the folder contents.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_folder_get_folders_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFolderGetFoldersByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_folder_get_folders_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModFolderGetFoldersByCoursesResponse:
        """Returns a list of folders in a provided list of courses, if no list is provided all folders that                             the user can view will be returned. Please note that this WS is not returning the folder contents.

        Returns a list of folders in a provided list of courses, if no list is provided all folders that                             the user can view will be returned. Please note that this WS is not returning the folder contents.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_folder_get_folders_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFolderGetFoldersByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_folder_get_folders_by_courses_from_args(
        self,
        args
    ) -> ModFolderGetFoldersByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFolderGetFoldersByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_folder_get_folders_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModFolderGetFoldersByCoursesResponse]:
        """Returns a list of folders in a provided list of courses, if no list is provided all folders that                             the user can view will be returned. Please note that this WS is not returning the folder contents.

        Returns a list of folders in a provided list of courses, if no list is provided all folders that                             the user can view will be returned. Please note that this WS is not returning the folder contents.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_folder_get_folders_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFolderGetFoldersByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_folder_get_folders_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of folders in a provided list of courses, if no list is provided all folders that                             the user can view will be returned. Please note that this WS is not returning the folder contents.

        Returns a list of folders in a provided list of courses, if no list is provided all folders that                             the user can view will be returned. Please note that this WS is not returning the folder contents.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_folder_get_folders_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFolderGetFoldersByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_folder_get_folders_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_folder_get_folders_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_folder_get_folders_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_folder_get_folders_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_folder_view_folder_args(
        self,
        folderid: Annotated[Optional[StrictInt], Field(description="folder instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Simulate the view.php web interface folder: trigger events, completion, etc...

        Simulate the view.php web interface folder: trigger events, completion, etc...

        :param folderid: folder instance id (required)
        :type folderid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_folder_view_folder_serialize(
            folderid=folderid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFolderViewFolderResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_folder_view_folder(
        self,
        folderid: Annotated[Optional[StrictInt], Field(description="folder instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModFolderViewFolderResponse:
        """Simulate the view.php web interface folder: trigger events, completion, etc...

        Simulate the view.php web interface folder: trigger events, completion, etc...

        :param folderid: folder instance id (required)
        :type folderid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_folder_view_folder_serialize(
            folderid=folderid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFolderViewFolderResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_folder_view_folder_from_args(
        self,
        args
    ) -> ModFolderViewFolderResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFolderViewFolderResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_folder_view_folder_with_http_info(
        self,
        folderid: Annotated[Optional[StrictInt], Field(description="folder instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModFolderViewFolderResponse]:
        """Simulate the view.php web interface folder: trigger events, completion, etc...

        Simulate the view.php web interface folder: trigger events, completion, etc...

        :param folderid: folder instance id (required)
        :type folderid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_folder_view_folder_serialize(
            folderid=folderid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFolderViewFolderResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_folder_view_folder_without_preload_content(
        self,
        folderid: Annotated[Optional[StrictInt], Field(description="folder instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Simulate the view.php web interface folder: trigger events, completion, etc...

        Simulate the view.php web interface folder: trigger events, completion, etc...

        :param folderid: folder instance id (required)
        :type folderid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_folder_view_folder_serialize(
            folderid=folderid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModFolderViewFolderResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_folder_view_folder_serialize(
        self,
        folderid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_folder_view_folder'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_folder_view_folder'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_folder_view_folder',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if folderid is not None:
            _form_params += parse_form({'folderid': folderid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_add_discussion_args(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="Forum instance ID")],
        message: Annotated[Optional[StrictStr], Field(description="New Discussion message (only html format allowed)")],
        subject: Annotated[Optional[StrictStr], Field(description="New Discussion subject")],
        groupid: Annotated[Optional[StrictInt], Field(description="The group, default to 0")] = None,
        options: Annotated[Optional[List[ModForumAddDiscussionParametersOptionsInner]], Field(description="Options")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Add a new discussion into an existing forum.

        Add a new discussion into an existing forum.

        :param forumid: Forum instance ID (required)
        :type forumid: int
        :param message: New Discussion message (only html format allowed) (required)
        :type message: str
        :param subject: New Discussion subject (required)
        :type subject: str
        :param groupid: The group, default to 0
        :type groupid: int
        :param options: Options
        :type options: List[ModForumAddDiscussionParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_add_discussion_serialize(
            forumid=forumid,
            message=message,
            subject=subject,
            groupid=groupid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumAddDiscussionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_add_discussion(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="Forum instance ID")],
        message: Annotated[Optional[StrictStr], Field(description="New Discussion message (only html format allowed)")],
        subject: Annotated[Optional[StrictStr], Field(description="New Discussion subject")],
        groupid: Annotated[Optional[StrictInt], Field(description="The group, default to 0")] = None,
        options: Annotated[Optional[List[ModForumAddDiscussionParametersOptionsInner]], Field(description="Options")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumAddDiscussionResponse:
        """Add a new discussion into an existing forum.

        Add a new discussion into an existing forum.

        :param forumid: Forum instance ID (required)
        :type forumid: int
        :param message: New Discussion message (only html format allowed) (required)
        :type message: str
        :param subject: New Discussion subject (required)
        :type subject: str
        :param groupid: The group, default to 0
        :type groupid: int
        :param options: Options
        :type options: List[ModForumAddDiscussionParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_add_discussion_serialize(
            forumid=forumid,
            message=message,
            subject=subject,
            groupid=groupid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumAddDiscussionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_add_discussion_from_args(
        self,
        args
    ) -> ModForumAddDiscussionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumAddDiscussionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_add_discussion_with_http_info(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="Forum instance ID")],
        message: Annotated[Optional[StrictStr], Field(description="New Discussion message (only html format allowed)")],
        subject: Annotated[Optional[StrictStr], Field(description="New Discussion subject")],
        groupid: Annotated[Optional[StrictInt], Field(description="The group, default to 0")] = None,
        options: Annotated[Optional[List[ModForumAddDiscussionParametersOptionsInner]], Field(description="Options")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumAddDiscussionResponse]:
        """Add a new discussion into an existing forum.

        Add a new discussion into an existing forum.

        :param forumid: Forum instance ID (required)
        :type forumid: int
        :param message: New Discussion message (only html format allowed) (required)
        :type message: str
        :param subject: New Discussion subject (required)
        :type subject: str
        :param groupid: The group, default to 0
        :type groupid: int
        :param options: Options
        :type options: List[ModForumAddDiscussionParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_add_discussion_serialize(
            forumid=forumid,
            message=message,
            subject=subject,
            groupid=groupid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumAddDiscussionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_add_discussion_without_preload_content(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="Forum instance ID")],
        message: Annotated[Optional[StrictStr], Field(description="New Discussion message (only html format allowed)")],
        subject: Annotated[Optional[StrictStr], Field(description="New Discussion subject")],
        groupid: Annotated[Optional[StrictInt], Field(description="The group, default to 0")] = None,
        options: Annotated[Optional[List[ModForumAddDiscussionParametersOptionsInner]], Field(description="Options")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Add a new discussion into an existing forum.

        Add a new discussion into an existing forum.

        :param forumid: Forum instance ID (required)
        :type forumid: int
        :param message: New Discussion message (only html format allowed) (required)
        :type message: str
        :param subject: New Discussion subject (required)
        :type subject: str
        :param groupid: The group, default to 0
        :type groupid: int
        :param options: Options
        :type options: List[ModForumAddDiscussionParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_add_discussion_serialize(
            forumid=forumid,
            message=message,
            subject=subject,
            groupid=groupid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumAddDiscussionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_add_discussion_serialize(
        self,
        forumid,
        message,
        subject,
        groupid,
        options,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'options': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_add_discussion'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_add_discussion'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_add_discussion',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if forumid is not None:
            _form_params += parse_form({'forumid': forumid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if message is not None:
            _form_params += parse_form({'message': message})
        if options is not None:
            _form_params += parse_form({'options': options})
        if subject is not None:
            _form_params += parse_form({'subject': subject})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_add_discussion_post_args(
        self,
        message: Annotated[Optional[StrictStr], Field(description="new post message (html assumed if messageformat is not provided)")],
        postid: Annotated[Optional[StrictInt], Field(description="the post id we are going to reply to                                                 (can be the initial discussion post")],
        subject: Annotated[Optional[StrictStr], Field(description="new post subject")],
        messageformat: Annotated[Optional[StrictInt], Field(description="message format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")] = None,
        options: Annotated[Optional[List[ModForumAddDiscussionPostParametersOptionsInner]], Field(description="Options")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Create new posts into an existing discussion.

        Create new posts into an existing discussion.

        :param message: new post message (html assumed if messageformat is not provided) (required)
        :type message: str
        :param postid: the post id we are going to reply to                                                 (can be the initial discussion post (required)
        :type postid: int
        :param subject: new post subject (required)
        :type subject: str
        :param messageformat: message format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)
        :type messageformat: int
        :param options: Options
        :type options: List[ModForumAddDiscussionPostParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_add_discussion_post_serialize(
            message=message,
            postid=postid,
            subject=subject,
            messageformat=messageformat,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumAddDiscussionPostResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_add_discussion_post(
        self,
        message: Annotated[Optional[StrictStr], Field(description="new post message (html assumed if messageformat is not provided)")],
        postid: Annotated[Optional[StrictInt], Field(description="the post id we are going to reply to                                                 (can be the initial discussion post")],
        subject: Annotated[Optional[StrictStr], Field(description="new post subject")],
        messageformat: Annotated[Optional[StrictInt], Field(description="message format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")] = None,
        options: Annotated[Optional[List[ModForumAddDiscussionPostParametersOptionsInner]], Field(description="Options")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumAddDiscussionPostResponse:
        """Create new posts into an existing discussion.

        Create new posts into an existing discussion.

        :param message: new post message (html assumed if messageformat is not provided) (required)
        :type message: str
        :param postid: the post id we are going to reply to                                                 (can be the initial discussion post (required)
        :type postid: int
        :param subject: new post subject (required)
        :type subject: str
        :param messageformat: message format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)
        :type messageformat: int
        :param options: Options
        :type options: List[ModForumAddDiscussionPostParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_add_discussion_post_serialize(
            message=message,
            postid=postid,
            subject=subject,
            messageformat=messageformat,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumAddDiscussionPostResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_add_discussion_post_from_args(
        self,
        args
    ) -> ModForumAddDiscussionPostResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumAddDiscussionPostResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_add_discussion_post_with_http_info(
        self,
        message: Annotated[Optional[StrictStr], Field(description="new post message (html assumed if messageformat is not provided)")],
        postid: Annotated[Optional[StrictInt], Field(description="the post id we are going to reply to                                                 (can be the initial discussion post")],
        subject: Annotated[Optional[StrictStr], Field(description="new post subject")],
        messageformat: Annotated[Optional[StrictInt], Field(description="message format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")] = None,
        options: Annotated[Optional[List[ModForumAddDiscussionPostParametersOptionsInner]], Field(description="Options")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumAddDiscussionPostResponse]:
        """Create new posts into an existing discussion.

        Create new posts into an existing discussion.

        :param message: new post message (html assumed if messageformat is not provided) (required)
        :type message: str
        :param postid: the post id we are going to reply to                                                 (can be the initial discussion post (required)
        :type postid: int
        :param subject: new post subject (required)
        :type subject: str
        :param messageformat: message format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)
        :type messageformat: int
        :param options: Options
        :type options: List[ModForumAddDiscussionPostParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_add_discussion_post_serialize(
            message=message,
            postid=postid,
            subject=subject,
            messageformat=messageformat,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumAddDiscussionPostResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_add_discussion_post_without_preload_content(
        self,
        message: Annotated[Optional[StrictStr], Field(description="new post message (html assumed if messageformat is not provided)")],
        postid: Annotated[Optional[StrictInt], Field(description="the post id we are going to reply to                                                 (can be the initial discussion post")],
        subject: Annotated[Optional[StrictStr], Field(description="new post subject")],
        messageformat: Annotated[Optional[StrictInt], Field(description="message format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")] = None,
        options: Annotated[Optional[List[ModForumAddDiscussionPostParametersOptionsInner]], Field(description="Options")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create new posts into an existing discussion.

        Create new posts into an existing discussion.

        :param message: new post message (html assumed if messageformat is not provided) (required)
        :type message: str
        :param postid: the post id we are going to reply to                                                 (can be the initial discussion post (required)
        :type postid: int
        :param subject: new post subject (required)
        :type subject: str
        :param messageformat: message format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)
        :type messageformat: int
        :param options: Options
        :type options: List[ModForumAddDiscussionPostParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_add_discussion_post_serialize(
            message=message,
            postid=postid,
            subject=subject,
            messageformat=messageformat,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumAddDiscussionPostResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_add_discussion_post_serialize(
        self,
        message,
        postid,
        subject,
        messageformat,
        options,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'options': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_add_discussion_post'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_add_discussion_post'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_add_discussion_post',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if message is not None:
            _form_params += parse_form({'message': message})
        if messageformat is not None:
            _form_params += parse_form({'messageformat': messageformat})
        if options is not None:
            _form_params += parse_form({'options': options})
        if postid is not None:
            _form_params += parse_form({'postid': postid})
        if subject is not None:
            _form_params += parse_form({'subject': subject})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_can_add_discussion_args(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="Forum instance ID")],
        groupid: Annotated[Optional[StrictInt], Field(description="The group to check, default to active group.                                                 Use -1 to check if the user can post in all the groups.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Check if the current user can add discussions in the given forum (and optionally for the given group).

        Check if the current user can add discussions in the given forum (and optionally for the given group).

        :param forumid: Forum instance ID (required)
        :type forumid: int
        :param groupid: The group to check, default to active group.                                                 Use -1 to check if the user can post in all the groups.
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_can_add_discussion_serialize(
            forumid=forumid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumCanAddDiscussionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_can_add_discussion(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="Forum instance ID")],
        groupid: Annotated[Optional[StrictInt], Field(description="The group to check, default to active group.                                                 Use -1 to check if the user can post in all the groups.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumCanAddDiscussionResponse:
        """Check if the current user can add discussions in the given forum (and optionally for the given group).

        Check if the current user can add discussions in the given forum (and optionally for the given group).

        :param forumid: Forum instance ID (required)
        :type forumid: int
        :param groupid: The group to check, default to active group.                                                 Use -1 to check if the user can post in all the groups.
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_can_add_discussion_serialize(
            forumid=forumid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumCanAddDiscussionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_can_add_discussion_from_args(
        self,
        args
    ) -> ModForumCanAddDiscussionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumCanAddDiscussionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_can_add_discussion_with_http_info(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="Forum instance ID")],
        groupid: Annotated[Optional[StrictInt], Field(description="The group to check, default to active group.                                                 Use -1 to check if the user can post in all the groups.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumCanAddDiscussionResponse]:
        """Check if the current user can add discussions in the given forum (and optionally for the given group).

        Check if the current user can add discussions in the given forum (and optionally for the given group).

        :param forumid: Forum instance ID (required)
        :type forumid: int
        :param groupid: The group to check, default to active group.                                                 Use -1 to check if the user can post in all the groups.
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_can_add_discussion_serialize(
            forumid=forumid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumCanAddDiscussionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_can_add_discussion_without_preload_content(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="Forum instance ID")],
        groupid: Annotated[Optional[StrictInt], Field(description="The group to check, default to active group.                                                 Use -1 to check if the user can post in all the groups.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Check if the current user can add discussions in the given forum (and optionally for the given group).

        Check if the current user can add discussions in the given forum (and optionally for the given group).

        :param forumid: Forum instance ID (required)
        :type forumid: int
        :param groupid: The group to check, default to active group.                                                 Use -1 to check if the user can post in all the groups.
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_can_add_discussion_serialize(
            forumid=forumid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumCanAddDiscussionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_can_add_discussion_serialize(
        self,
        forumid,
        groupid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_can_add_discussion'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_can_add_discussion'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_can_add_discussion',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if forumid is not None:
            _form_params += parse_form({'forumid': forumid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_delete_post_args(
        self,
        postid: Annotated[Optional[StrictInt], Field(description="Post to be deleted. It can be a discussion topic post.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes a post or a discussion completely when the post is the discussion topic.

        Deletes a post or a discussion completely when the post is the discussion topic.

        :param postid: Post to be deleted. It can be a discussion topic post. (required)
        :type postid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_delete_post_serialize(
            postid=postid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumDeletePostResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_delete_post(
        self,
        postid: Annotated[Optional[StrictInt], Field(description="Post to be deleted. It can be a discussion topic post.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumDeletePostResponse:
        """Deletes a post or a discussion completely when the post is the discussion topic.

        Deletes a post or a discussion completely when the post is the discussion topic.

        :param postid: Post to be deleted. It can be a discussion topic post. (required)
        :type postid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_delete_post_serialize(
            postid=postid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumDeletePostResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_delete_post_from_args(
        self,
        args
    ) -> ModForumDeletePostResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumDeletePostResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_delete_post_with_http_info(
        self,
        postid: Annotated[Optional[StrictInt], Field(description="Post to be deleted. It can be a discussion topic post.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumDeletePostResponse]:
        """Deletes a post or a discussion completely when the post is the discussion topic.

        Deletes a post or a discussion completely when the post is the discussion topic.

        :param postid: Post to be deleted. It can be a discussion topic post. (required)
        :type postid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_delete_post_serialize(
            postid=postid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumDeletePostResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_delete_post_without_preload_content(
        self,
        postid: Annotated[Optional[StrictInt], Field(description="Post to be deleted. It can be a discussion topic post.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes a post or a discussion completely when the post is the discussion topic.

        Deletes a post or a discussion completely when the post is the discussion topic.

        :param postid: Post to be deleted. It can be a discussion topic post. (required)
        :type postid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_delete_post_serialize(
            postid=postid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumDeletePostResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_delete_post_serialize(
        self,
        postid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_delete_post'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_delete_post'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_delete_post',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if postid is not None:
            _form_params += parse_form({'postid': postid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_get_discussion_post_args(
        self,
        postid: Annotated[Optional[StrictInt], Field(description="Post to fetch.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get a particular discussion post.

        Get a particular discussion post.

        :param postid: Post to fetch. (required)
        :type postid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_discussion_post_serialize(
            postid=postid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetDiscussionPostResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_get_discussion_post(
        self,
        postid: Annotated[Optional[StrictInt], Field(description="Post to fetch.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumGetDiscussionPostResponse:
        """Get a particular discussion post.

        Get a particular discussion post.

        :param postid: Post to fetch. (required)
        :type postid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_discussion_post_serialize(
            postid=postid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetDiscussionPostResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_get_discussion_post_from_args(
        self,
        args
    ) -> ModForumGetDiscussionPostResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetDiscussionPostResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_get_discussion_post_with_http_info(
        self,
        postid: Annotated[Optional[StrictInt], Field(description="Post to fetch.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumGetDiscussionPostResponse]:
        """Get a particular discussion post.

        Get a particular discussion post.

        :param postid: Post to fetch. (required)
        :type postid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_discussion_post_serialize(
            postid=postid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetDiscussionPostResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_get_discussion_post_without_preload_content(
        self,
        postid: Annotated[Optional[StrictInt], Field(description="Post to fetch.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get a particular discussion post.

        Get a particular discussion post.

        :param postid: Post to fetch. (required)
        :type postid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_discussion_post_serialize(
            postid=postid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetDiscussionPostResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_get_discussion_post_serialize(
        self,
        postid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_get_discussion_post'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_get_discussion_post'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_get_discussion_post',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if postid is not None:
            _form_params += parse_form({'postid': postid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_get_discussion_posts_args(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="The ID of the discussion from which to fetch posts.")],
        includeinlineattachments: Annotated[Optional[StrictBool], Field(description="Whether inline attachments should be included or not")] = None,
        sortby: Annotated[Optional[StrictStr], Field(description="Sort by this element: id, created or modified")] = None,
        sortdirection: Annotated[Optional[StrictStr], Field(description="Sort direction: ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of forum posts for a discussion.

        Returns a list of forum posts for a discussion.

        :param discussionid: The ID of the discussion from which to fetch posts. (required)
        :type discussionid: int
        :param includeinlineattachments: Whether inline attachments should be included or not
        :type includeinlineattachments: bool
        :param sortby: Sort by this element: id, created or modified
        :type sortby: str
        :param sortdirection: Sort direction: ASC or DESC
        :type sortdirection: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_discussion_posts_serialize(
            discussionid=discussionid,
            includeinlineattachments=includeinlineattachments,
            sortby=sortby,
            sortdirection=sortdirection,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetDiscussionPostsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_get_discussion_posts(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="The ID of the discussion from which to fetch posts.")],
        includeinlineattachments: Annotated[Optional[StrictBool], Field(description="Whether inline attachments should be included or not")] = None,
        sortby: Annotated[Optional[StrictStr], Field(description="Sort by this element: id, created or modified")] = None,
        sortdirection: Annotated[Optional[StrictStr], Field(description="Sort direction: ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumGetDiscussionPostsResponse:
        """Returns a list of forum posts for a discussion.

        Returns a list of forum posts for a discussion.

        :param discussionid: The ID of the discussion from which to fetch posts. (required)
        :type discussionid: int
        :param includeinlineattachments: Whether inline attachments should be included or not
        :type includeinlineattachments: bool
        :param sortby: Sort by this element: id, created or modified
        :type sortby: str
        :param sortdirection: Sort direction: ASC or DESC
        :type sortdirection: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_discussion_posts_serialize(
            discussionid=discussionid,
            includeinlineattachments=includeinlineattachments,
            sortby=sortby,
            sortdirection=sortdirection,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetDiscussionPostsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_get_discussion_posts_from_args(
        self,
        args
    ) -> ModForumGetDiscussionPostsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetDiscussionPostsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_get_discussion_posts_with_http_info(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="The ID of the discussion from which to fetch posts.")],
        includeinlineattachments: Annotated[Optional[StrictBool], Field(description="Whether inline attachments should be included or not")] = None,
        sortby: Annotated[Optional[StrictStr], Field(description="Sort by this element: id, created or modified")] = None,
        sortdirection: Annotated[Optional[StrictStr], Field(description="Sort direction: ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumGetDiscussionPostsResponse]:
        """Returns a list of forum posts for a discussion.

        Returns a list of forum posts for a discussion.

        :param discussionid: The ID of the discussion from which to fetch posts. (required)
        :type discussionid: int
        :param includeinlineattachments: Whether inline attachments should be included or not
        :type includeinlineattachments: bool
        :param sortby: Sort by this element: id, created or modified
        :type sortby: str
        :param sortdirection: Sort direction: ASC or DESC
        :type sortdirection: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_discussion_posts_serialize(
            discussionid=discussionid,
            includeinlineattachments=includeinlineattachments,
            sortby=sortby,
            sortdirection=sortdirection,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetDiscussionPostsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_get_discussion_posts_without_preload_content(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="The ID of the discussion from which to fetch posts.")],
        includeinlineattachments: Annotated[Optional[StrictBool], Field(description="Whether inline attachments should be included or not")] = None,
        sortby: Annotated[Optional[StrictStr], Field(description="Sort by this element: id, created or modified")] = None,
        sortdirection: Annotated[Optional[StrictStr], Field(description="Sort direction: ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of forum posts for a discussion.

        Returns a list of forum posts for a discussion.

        :param discussionid: The ID of the discussion from which to fetch posts. (required)
        :type discussionid: int
        :param includeinlineattachments: Whether inline attachments should be included or not
        :type includeinlineattachments: bool
        :param sortby: Sort by this element: id, created or modified
        :type sortby: str
        :param sortdirection: Sort direction: ASC or DESC
        :type sortdirection: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_discussion_posts_serialize(
            discussionid=discussionid,
            includeinlineattachments=includeinlineattachments,
            sortby=sortby,
            sortdirection=sortdirection,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetDiscussionPostsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_get_discussion_posts_serialize(
        self,
        discussionid,
        includeinlineattachments,
        sortby,
        sortdirection,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_get_discussion_posts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_get_discussion_posts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_get_discussion_posts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if discussionid is not None:
            _form_params += parse_form({'discussionid': discussionid})
        if includeinlineattachments is not None:
            _form_params += parse_form({'includeinlineattachments': includeinlineattachments})
        if sortby is not None:
            _form_params += parse_form({'sortby': sortby})
        if sortdirection is not None:
            _form_params += parse_form({'sortdirection': sortdirection})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_get_discussion_posts_by_userid_args(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The ID of the module of which to fetch items.")],
        userid: Annotated[Optional[StrictInt], Field(description="The ID of the user of whom to fetch posts.")],
        sortby: Annotated[Optional[StrictStr], Field(description="Sort by this element: id, created or modified")] = None,
        sortdirection: Annotated[Optional[StrictStr], Field(description="Sort direction: ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of forum posts for a discussion for a user.

        Returns a list of forum posts for a discussion for a user.

        :param cmid: The ID of the module of which to fetch items. (required)
        :type cmid: int
        :param userid: The ID of the user of whom to fetch posts. (required)
        :type userid: int
        :param sortby: Sort by this element: id, created or modified
        :type sortby: str
        :param sortdirection: Sort direction: ASC or DESC
        :type sortdirection: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_discussion_posts_by_userid_serialize(
            cmid=cmid,
            userid=userid,
            sortby=sortby,
            sortdirection=sortdirection,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetDiscussionPostsByUseridResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_get_discussion_posts_by_userid(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The ID of the module of which to fetch items.")],
        userid: Annotated[Optional[StrictInt], Field(description="The ID of the user of whom to fetch posts.")],
        sortby: Annotated[Optional[StrictStr], Field(description="Sort by this element: id, created or modified")] = None,
        sortdirection: Annotated[Optional[StrictStr], Field(description="Sort direction: ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumGetDiscussionPostsByUseridResponse:
        """Returns a list of forum posts for a discussion for a user.

        Returns a list of forum posts for a discussion for a user.

        :param cmid: The ID of the module of which to fetch items. (required)
        :type cmid: int
        :param userid: The ID of the user of whom to fetch posts. (required)
        :type userid: int
        :param sortby: Sort by this element: id, created or modified
        :type sortby: str
        :param sortdirection: Sort direction: ASC or DESC
        :type sortdirection: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_discussion_posts_by_userid_serialize(
            cmid=cmid,
            userid=userid,
            sortby=sortby,
            sortdirection=sortdirection,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetDiscussionPostsByUseridResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_get_discussion_posts_by_userid_from_args(
        self,
        args
    ) -> ModForumGetDiscussionPostsByUseridResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetDiscussionPostsByUseridResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_get_discussion_posts_by_userid_with_http_info(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The ID of the module of which to fetch items.")],
        userid: Annotated[Optional[StrictInt], Field(description="The ID of the user of whom to fetch posts.")],
        sortby: Annotated[Optional[StrictStr], Field(description="Sort by this element: id, created or modified")] = None,
        sortdirection: Annotated[Optional[StrictStr], Field(description="Sort direction: ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumGetDiscussionPostsByUseridResponse]:
        """Returns a list of forum posts for a discussion for a user.

        Returns a list of forum posts for a discussion for a user.

        :param cmid: The ID of the module of which to fetch items. (required)
        :type cmid: int
        :param userid: The ID of the user of whom to fetch posts. (required)
        :type userid: int
        :param sortby: Sort by this element: id, created or modified
        :type sortby: str
        :param sortdirection: Sort direction: ASC or DESC
        :type sortdirection: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_discussion_posts_by_userid_serialize(
            cmid=cmid,
            userid=userid,
            sortby=sortby,
            sortdirection=sortdirection,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetDiscussionPostsByUseridResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_get_discussion_posts_by_userid_without_preload_content(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The ID of the module of which to fetch items.")],
        userid: Annotated[Optional[StrictInt], Field(description="The ID of the user of whom to fetch posts.")],
        sortby: Annotated[Optional[StrictStr], Field(description="Sort by this element: id, created or modified")] = None,
        sortdirection: Annotated[Optional[StrictStr], Field(description="Sort direction: ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of forum posts for a discussion for a user.

        Returns a list of forum posts for a discussion for a user.

        :param cmid: The ID of the module of which to fetch items. (required)
        :type cmid: int
        :param userid: The ID of the user of whom to fetch posts. (required)
        :type userid: int
        :param sortby: Sort by this element: id, created or modified
        :type sortby: str
        :param sortdirection: Sort direction: ASC or DESC
        :type sortdirection: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_discussion_posts_by_userid_serialize(
            cmid=cmid,
            userid=userid,
            sortby=sortby,
            sortdirection=sortdirection,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetDiscussionPostsByUseridResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_get_discussion_posts_by_userid_serialize(
        self,
        cmid,
        userid,
        sortby,
        sortdirection,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_get_discussion_posts_by_userid'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_get_discussion_posts_by_userid'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_get_discussion_posts_by_userid',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        if sortby is not None:
            _form_params += parse_form({'sortby': sortby})
        if sortdirection is not None:
            _form_params += parse_form({'sortdirection': sortdirection})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_get_forum_access_information_args(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="Forum instance id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return capabilities information for a given forum.

        Return capabilities information for a given forum.

        :param forumid: Forum instance id. (required)
        :type forumid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_forum_access_information_serialize(
            forumid=forumid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetForumAccessInformationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_get_forum_access_information(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="Forum instance id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumGetForumAccessInformationResponse:
        """Return capabilities information for a given forum.

        Return capabilities information for a given forum.

        :param forumid: Forum instance id. (required)
        :type forumid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_forum_access_information_serialize(
            forumid=forumid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetForumAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_get_forum_access_information_from_args(
        self,
        args
    ) -> ModForumGetForumAccessInformationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetForumAccessInformationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_get_forum_access_information_with_http_info(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="Forum instance id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumGetForumAccessInformationResponse]:
        """Return capabilities information for a given forum.

        Return capabilities information for a given forum.

        :param forumid: Forum instance id. (required)
        :type forumid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_forum_access_information_serialize(
            forumid=forumid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetForumAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_get_forum_access_information_without_preload_content(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="Forum instance id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return capabilities information for a given forum.

        Return capabilities information for a given forum.

        :param forumid: Forum instance id. (required)
        :type forumid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_forum_access_information_serialize(
            forumid=forumid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetForumAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_get_forum_access_information_serialize(
        self,
        forumid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_get_forum_access_information'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_get_forum_access_information'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_get_forum_access_information',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if forumid is not None:
            _form_params += parse_form({'forumid': forumid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_get_forum_discussions_args(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="forum instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="group id")] = None,
        page: Annotated[Optional[StrictInt], Field(description="current page")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="items per page")] = None,
        sortorder: Annotated[Optional[StrictInt], Field(description="sort by this element: numreplies, , created or timemodified")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of forum discussions optionally sorted and paginated.

        Returns a list of forum discussions optionally sorted and paginated.

        :param forumid: forum instance id (required)
        :type forumid: int
        :param groupid: group id
        :type groupid: int
        :param page: current page
        :type page: int
        :param perpage: items per page
        :type perpage: int
        :param sortorder: sort by this element: numreplies, , created or timemodified
        :type sortorder: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_forum_discussions_serialize(
            forumid=forumid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            sortorder=sortorder,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetForumDiscussionsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_get_forum_discussions(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="forum instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="group id")] = None,
        page: Annotated[Optional[StrictInt], Field(description="current page")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="items per page")] = None,
        sortorder: Annotated[Optional[StrictInt], Field(description="sort by this element: numreplies, , created or timemodified")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumGetForumDiscussionsResponse:
        """Returns a list of forum discussions optionally sorted and paginated.

        Returns a list of forum discussions optionally sorted and paginated.

        :param forumid: forum instance id (required)
        :type forumid: int
        :param groupid: group id
        :type groupid: int
        :param page: current page
        :type page: int
        :param perpage: items per page
        :type perpage: int
        :param sortorder: sort by this element: numreplies, , created or timemodified
        :type sortorder: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_forum_discussions_serialize(
            forumid=forumid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            sortorder=sortorder,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetForumDiscussionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_get_forum_discussions_from_args(
        self,
        args
    ) -> ModForumGetForumDiscussionsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetForumDiscussionsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_get_forum_discussions_with_http_info(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="forum instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="group id")] = None,
        page: Annotated[Optional[StrictInt], Field(description="current page")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="items per page")] = None,
        sortorder: Annotated[Optional[StrictInt], Field(description="sort by this element: numreplies, , created or timemodified")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumGetForumDiscussionsResponse]:
        """Returns a list of forum discussions optionally sorted and paginated.

        Returns a list of forum discussions optionally sorted and paginated.

        :param forumid: forum instance id (required)
        :type forumid: int
        :param groupid: group id
        :type groupid: int
        :param page: current page
        :type page: int
        :param perpage: items per page
        :type perpage: int
        :param sortorder: sort by this element: numreplies, , created or timemodified
        :type sortorder: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_forum_discussions_serialize(
            forumid=forumid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            sortorder=sortorder,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetForumDiscussionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_get_forum_discussions_without_preload_content(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="forum instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="group id")] = None,
        page: Annotated[Optional[StrictInt], Field(description="current page")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="items per page")] = None,
        sortorder: Annotated[Optional[StrictInt], Field(description="sort by this element: numreplies, , created or timemodified")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of forum discussions optionally sorted and paginated.

        Returns a list of forum discussions optionally sorted and paginated.

        :param forumid: forum instance id (required)
        :type forumid: int
        :param groupid: group id
        :type groupid: int
        :param page: current page
        :type page: int
        :param perpage: items per page
        :type perpage: int
        :param sortorder: sort by this element: numreplies, , created or timemodified
        :type sortorder: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_forum_discussions_serialize(
            forumid=forumid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            sortorder=sortorder,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumGetForumDiscussionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_get_forum_discussions_serialize(
        self,
        forumid,
        groupid,
        page,
        perpage,
        sortorder,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_get_forum_discussions'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_get_forum_discussions'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_get_forum_discussions',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if forumid is not None:
            _form_params += parse_form({'forumid': forumid})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if page is not None:
            _form_params += parse_form({'page': page})
        if perpage is not None:
            _form_params += parse_form({'perpage': perpage})
        if sortorder is not None:
            _form_params += parse_form({'sortorder': sortorder})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_get_forums_by_courses_args(
        self,
        courseids: Annotated[Optional[List[StrictInt]], Field(description="Array of Course IDs")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of forum instances in a provided set of courses, if             no courses are provided then all the forum instances the user has access to will be             returned.

        Returns a list of forum instances in a provided set of courses, if             no courses are provided then all the forum instances the user has access to will be             returned.

        :param courseids: Array of Course IDs
        :type courseids: List[int]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_forums_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModForumGetForumsByCoursesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_get_forums_by_courses(
        self,
        courseids: Annotated[Optional[List[StrictInt]], Field(description="Array of Course IDs")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[ModForumGetForumsByCoursesResponseInner]:
        """Returns a list of forum instances in a provided set of courses, if             no courses are provided then all the forum instances the user has access to will be             returned.

        Returns a list of forum instances in a provided set of courses, if             no courses are provided then all the forum instances the user has access to will be             returned.

        :param courseids: Array of Course IDs
        :type courseids: List[int]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_forums_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModForumGetForumsByCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_get_forums_by_courses_from_args(
        self,
        args
    ) -> List[ModForumGetForumsByCoursesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModForumGetForumsByCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_get_forums_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[StrictInt]], Field(description="Array of Course IDs")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[ModForumGetForumsByCoursesResponseInner]]:
        """Returns a list of forum instances in a provided set of courses, if             no courses are provided then all the forum instances the user has access to will be             returned.

        Returns a list of forum instances in a provided set of courses, if             no courses are provided then all the forum instances the user has access to will be             returned.

        :param courseids: Array of Course IDs
        :type courseids: List[int]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_forums_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModForumGetForumsByCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_get_forums_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[StrictInt]], Field(description="Array of Course IDs")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of forum instances in a provided set of courses, if             no courses are provided then all the forum instances the user has access to will be             returned.

        Returns a list of forum instances in a provided set of courses, if             no courses are provided then all the forum instances the user has access to will be             returned.

        :param courseids: Array of Course IDs
        :type courseids: List[int]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_get_forums_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModForumGetForumsByCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_get_forums_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_get_forums_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_get_forums_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_get_forums_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_prepare_draft_area_for_post_args(
        self,
        area: Annotated[Optional[StrictStr], Field(description="Area to prepare: attachment or post.")],
        postid: Annotated[Optional[StrictInt], Field(description="Post to prepare the draft area for.")],
        draftitemid: Annotated[Optional[StrictInt], Field(description="The draft item id to use. 0 to generate one.")] = None,
        filestokeep: Annotated[Optional[List[ModForumPrepareDraftAreaForPostParametersFilestokeepInner]], Field(description="Only keep these files in the draft file area. Empty for keeping all.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Prepares a draft area for editing a post.

        Prepares a draft area for editing a post.

        :param area: Area to prepare: attachment or post. (required)
        :type area: str
        :param postid: Post to prepare the draft area for. (required)
        :type postid: int
        :param draftitemid: The draft item id to use. 0 to generate one.
        :type draftitemid: int
        :param filestokeep: Only keep these files in the draft file area. Empty for keeping all.
        :type filestokeep: List[ModForumPrepareDraftAreaForPostParametersFilestokeepInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_prepare_draft_area_for_post_serialize(
            area=area,
            postid=postid,
            draftitemid=draftitemid,
            filestokeep=filestokeep,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumPrepareDraftAreaForPostResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_prepare_draft_area_for_post(
        self,
        area: Annotated[Optional[StrictStr], Field(description="Area to prepare: attachment or post.")],
        postid: Annotated[Optional[StrictInt], Field(description="Post to prepare the draft area for.")],
        draftitemid: Annotated[Optional[StrictInt], Field(description="The draft item id to use. 0 to generate one.")] = None,
        filestokeep: Annotated[Optional[List[ModForumPrepareDraftAreaForPostParametersFilestokeepInner]], Field(description="Only keep these files in the draft file area. Empty for keeping all.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumPrepareDraftAreaForPostResponse:
        """Prepares a draft area for editing a post.

        Prepares a draft area for editing a post.

        :param area: Area to prepare: attachment or post. (required)
        :type area: str
        :param postid: Post to prepare the draft area for. (required)
        :type postid: int
        :param draftitemid: The draft item id to use. 0 to generate one.
        :type draftitemid: int
        :param filestokeep: Only keep these files in the draft file area. Empty for keeping all.
        :type filestokeep: List[ModForumPrepareDraftAreaForPostParametersFilestokeepInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_prepare_draft_area_for_post_serialize(
            area=area,
            postid=postid,
            draftitemid=draftitemid,
            filestokeep=filestokeep,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumPrepareDraftAreaForPostResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_prepare_draft_area_for_post_from_args(
        self,
        args
    ) -> ModForumPrepareDraftAreaForPostResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumPrepareDraftAreaForPostResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_prepare_draft_area_for_post_with_http_info(
        self,
        area: Annotated[Optional[StrictStr], Field(description="Area to prepare: attachment or post.")],
        postid: Annotated[Optional[StrictInt], Field(description="Post to prepare the draft area for.")],
        draftitemid: Annotated[Optional[StrictInt], Field(description="The draft item id to use. 0 to generate one.")] = None,
        filestokeep: Annotated[Optional[List[ModForumPrepareDraftAreaForPostParametersFilestokeepInner]], Field(description="Only keep these files in the draft file area. Empty for keeping all.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumPrepareDraftAreaForPostResponse]:
        """Prepares a draft area for editing a post.

        Prepares a draft area for editing a post.

        :param area: Area to prepare: attachment or post. (required)
        :type area: str
        :param postid: Post to prepare the draft area for. (required)
        :type postid: int
        :param draftitemid: The draft item id to use. 0 to generate one.
        :type draftitemid: int
        :param filestokeep: Only keep these files in the draft file area. Empty for keeping all.
        :type filestokeep: List[ModForumPrepareDraftAreaForPostParametersFilestokeepInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_prepare_draft_area_for_post_serialize(
            area=area,
            postid=postid,
            draftitemid=draftitemid,
            filestokeep=filestokeep,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumPrepareDraftAreaForPostResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_prepare_draft_area_for_post_without_preload_content(
        self,
        area: Annotated[Optional[StrictStr], Field(description="Area to prepare: attachment or post.")],
        postid: Annotated[Optional[StrictInt], Field(description="Post to prepare the draft area for.")],
        draftitemid: Annotated[Optional[StrictInt], Field(description="The draft item id to use. 0 to generate one.")] = None,
        filestokeep: Annotated[Optional[List[ModForumPrepareDraftAreaForPostParametersFilestokeepInner]], Field(description="Only keep these files in the draft file area. Empty for keeping all.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Prepares a draft area for editing a post.

        Prepares a draft area for editing a post.

        :param area: Area to prepare: attachment or post. (required)
        :type area: str
        :param postid: Post to prepare the draft area for. (required)
        :type postid: int
        :param draftitemid: The draft item id to use. 0 to generate one.
        :type draftitemid: int
        :param filestokeep: Only keep these files in the draft file area. Empty for keeping all.
        :type filestokeep: List[ModForumPrepareDraftAreaForPostParametersFilestokeepInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_prepare_draft_area_for_post_serialize(
            area=area,
            postid=postid,
            draftitemid=draftitemid,
            filestokeep=filestokeep,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumPrepareDraftAreaForPostResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_prepare_draft_area_for_post_serialize(
        self,
        area,
        postid,
        draftitemid,
        filestokeep,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'filestokeep': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_prepare_draft_area_for_post'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_prepare_draft_area_for_post'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_prepare_draft_area_for_post',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if area is not None:
            _form_params += parse_form({'area': area})
        if draftitemid is not None:
            _form_params += parse_form({'draftitemid': draftitemid})
        if filestokeep is not None:
            _form_params += parse_form({'filestokeep': filestokeep})
        if postid is not None:
            _form_params += parse_form({'postid': postid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_set_lock_state_args(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="The discussion to lock / unlock")],
        forumid: Annotated[Optional[StrictInt], Field(description="Forum that the discussion is in")],
        targetstate: Annotated[Optional[StrictInt], Field(description="The timestamp for the lock state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set the lock state for the discussion

        Set the lock state for the discussion

        :param discussionid: The discussion to lock / unlock (required)
        :type discussionid: int
        :param forumid: Forum that the discussion is in (required)
        :type forumid: int
        :param targetstate: The timestamp for the lock state (required)
        :type targetstate: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_set_lock_state_serialize(
            discussionid=discussionid,
            forumid=forumid,
            targetstate=targetstate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumSetLockStateResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_set_lock_state(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="The discussion to lock / unlock")],
        forumid: Annotated[Optional[StrictInt], Field(description="Forum that the discussion is in")],
        targetstate: Annotated[Optional[StrictInt], Field(description="The timestamp for the lock state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumSetLockStateResponse:
        """Set the lock state for the discussion

        Set the lock state for the discussion

        :param discussionid: The discussion to lock / unlock (required)
        :type discussionid: int
        :param forumid: Forum that the discussion is in (required)
        :type forumid: int
        :param targetstate: The timestamp for the lock state (required)
        :type targetstate: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_set_lock_state_serialize(
            discussionid=discussionid,
            forumid=forumid,
            targetstate=targetstate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumSetLockStateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_set_lock_state_from_args(
        self,
        args
    ) -> ModForumSetLockStateResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumSetLockStateResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_set_lock_state_with_http_info(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="The discussion to lock / unlock")],
        forumid: Annotated[Optional[StrictInt], Field(description="Forum that the discussion is in")],
        targetstate: Annotated[Optional[StrictInt], Field(description="The timestamp for the lock state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumSetLockStateResponse]:
        """Set the lock state for the discussion

        Set the lock state for the discussion

        :param discussionid: The discussion to lock / unlock (required)
        :type discussionid: int
        :param forumid: Forum that the discussion is in (required)
        :type forumid: int
        :param targetstate: The timestamp for the lock state (required)
        :type targetstate: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_set_lock_state_serialize(
            discussionid=discussionid,
            forumid=forumid,
            targetstate=targetstate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumSetLockStateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_set_lock_state_without_preload_content(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="The discussion to lock / unlock")],
        forumid: Annotated[Optional[StrictInt], Field(description="Forum that the discussion is in")],
        targetstate: Annotated[Optional[StrictInt], Field(description="The timestamp for the lock state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set the lock state for the discussion

        Set the lock state for the discussion

        :param discussionid: The discussion to lock / unlock (required)
        :type discussionid: int
        :param forumid: Forum that the discussion is in (required)
        :type forumid: int
        :param targetstate: The timestamp for the lock state (required)
        :type targetstate: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_set_lock_state_serialize(
            discussionid=discussionid,
            forumid=forumid,
            targetstate=targetstate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumSetLockStateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_set_lock_state_serialize(
        self,
        discussionid,
        forumid,
        targetstate,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_set_lock_state'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_set_lock_state'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_set_lock_state',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if discussionid is not None:
            _form_params += parse_form({'discussionid': discussionid})
        if forumid is not None:
            _form_params += parse_form({'forumid': forumid})
        if targetstate is not None:
            _form_params += parse_form({'targetstate': targetstate})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_set_pin_state_args(
        self,
        discussionid: Annotated[StrictInt, Field(description="The discussion to pin or unpin")],
        targetstate: Annotated[StrictInt, Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set the pin state

        Set the pin state

        :param discussionid: The discussion to pin or unpin (required)
        :type discussionid: int
        :param targetstate: The target state (required)
        :type targetstate: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_set_pin_state_serialize(
            discussionid=discussionid,
            targetstate=targetstate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumSetPinStateResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_set_pin_state(
        self,
        discussionid: Annotated[StrictInt, Field(description="The discussion to pin or unpin")],
        targetstate: Annotated[StrictInt, Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumSetPinStateResponse:
        """Set the pin state

        Set the pin state

        :param discussionid: The discussion to pin or unpin (required)
        :type discussionid: int
        :param targetstate: The target state (required)
        :type targetstate: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_set_pin_state_serialize(
            discussionid=discussionid,
            targetstate=targetstate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumSetPinStateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_set_pin_state_from_args(
        self,
        args
    ) -> ModForumSetPinStateResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumSetPinStateResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_set_pin_state_with_http_info(
        self,
        discussionid: Annotated[StrictInt, Field(description="The discussion to pin or unpin")],
        targetstate: Annotated[StrictInt, Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumSetPinStateResponse]:
        """Set the pin state

        Set the pin state

        :param discussionid: The discussion to pin or unpin (required)
        :type discussionid: int
        :param targetstate: The target state (required)
        :type targetstate: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_set_pin_state_serialize(
            discussionid=discussionid,
            targetstate=targetstate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumSetPinStateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_set_pin_state_without_preload_content(
        self,
        discussionid: Annotated[StrictInt, Field(description="The discussion to pin or unpin")],
        targetstate: Annotated[StrictInt, Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set the pin state

        Set the pin state

        :param discussionid: The discussion to pin or unpin (required)
        :type discussionid: int
        :param targetstate: The target state (required)
        :type targetstate: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_set_pin_state_serialize(
            discussionid=discussionid,
            targetstate=targetstate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumSetPinStateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_set_pin_state_serialize(
        self,
        discussionid,
        targetstate,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_set_pin_state'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_set_pin_state'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_set_pin_state',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if discussionid is not None:
            _form_params += parse_form({'discussionid': discussionid})
        if targetstate is not None:
            _form_params += parse_form({'targetstate': targetstate})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_set_subscription_state_args(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="The discussion to subscribe or unsubscribe")],
        forumid: Annotated[Optional[StrictInt], Field(description="Forum that the discussion is in")],
        targetstate: Annotated[Optional[StrictBool], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set the subscription state

        Set the subscription state

        :param discussionid: The discussion to subscribe or unsubscribe (required)
        :type discussionid: int
        :param forumid: Forum that the discussion is in (required)
        :type forumid: int
        :param targetstate: The target state (required)
        :type targetstate: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_set_subscription_state_serialize(
            discussionid=discussionid,
            forumid=forumid,
            targetstate=targetstate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumSetSubscriptionStateResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_set_subscription_state(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="The discussion to subscribe or unsubscribe")],
        forumid: Annotated[Optional[StrictInt], Field(description="Forum that the discussion is in")],
        targetstate: Annotated[Optional[StrictBool], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumSetSubscriptionStateResponse:
        """Set the subscription state

        Set the subscription state

        :param discussionid: The discussion to subscribe or unsubscribe (required)
        :type discussionid: int
        :param forumid: Forum that the discussion is in (required)
        :type forumid: int
        :param targetstate: The target state (required)
        :type targetstate: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_set_subscription_state_serialize(
            discussionid=discussionid,
            forumid=forumid,
            targetstate=targetstate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumSetSubscriptionStateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_set_subscription_state_from_args(
        self,
        args
    ) -> ModForumSetSubscriptionStateResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumSetSubscriptionStateResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_set_subscription_state_with_http_info(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="The discussion to subscribe or unsubscribe")],
        forumid: Annotated[Optional[StrictInt], Field(description="Forum that the discussion is in")],
        targetstate: Annotated[Optional[StrictBool], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumSetSubscriptionStateResponse]:
        """Set the subscription state

        Set the subscription state

        :param discussionid: The discussion to subscribe or unsubscribe (required)
        :type discussionid: int
        :param forumid: Forum that the discussion is in (required)
        :type forumid: int
        :param targetstate: The target state (required)
        :type targetstate: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_set_subscription_state_serialize(
            discussionid=discussionid,
            forumid=forumid,
            targetstate=targetstate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumSetSubscriptionStateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_set_subscription_state_without_preload_content(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="The discussion to subscribe or unsubscribe")],
        forumid: Annotated[Optional[StrictInt], Field(description="Forum that the discussion is in")],
        targetstate: Annotated[Optional[StrictBool], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set the subscription state

        Set the subscription state

        :param discussionid: The discussion to subscribe or unsubscribe (required)
        :type discussionid: int
        :param forumid: Forum that the discussion is in (required)
        :type forumid: int
        :param targetstate: The target state (required)
        :type targetstate: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_set_subscription_state_serialize(
            discussionid=discussionid,
            forumid=forumid,
            targetstate=targetstate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumSetSubscriptionStateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_set_subscription_state_serialize(
        self,
        discussionid,
        forumid,
        targetstate,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_set_subscription_state'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_set_subscription_state'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_set_subscription_state',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if discussionid is not None:
            _form_params += parse_form({'discussionid': discussionid})
        if forumid is not None:
            _form_params += parse_form({'forumid': forumid})
        if targetstate is not None:
            _form_params += parse_form({'targetstate': targetstate})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_toggle_favourite_state_args(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="The discussion to subscribe or unsubscribe")],
        targetstate: Annotated[Optional[StrictBool], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Toggle the favourite state

        Toggle the favourite state

        :param discussionid: The discussion to subscribe or unsubscribe (required)
        :type discussionid: int
        :param targetstate: The target state (required)
        :type targetstate: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_toggle_favourite_state_serialize(
            discussionid=discussionid,
            targetstate=targetstate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumToggleFavouriteStateResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_toggle_favourite_state(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="The discussion to subscribe or unsubscribe")],
        targetstate: Annotated[Optional[StrictBool], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumToggleFavouriteStateResponse:
        """Toggle the favourite state

        Toggle the favourite state

        :param discussionid: The discussion to subscribe or unsubscribe (required)
        :type discussionid: int
        :param targetstate: The target state (required)
        :type targetstate: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_toggle_favourite_state_serialize(
            discussionid=discussionid,
            targetstate=targetstate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumToggleFavouriteStateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_toggle_favourite_state_from_args(
        self,
        args
    ) -> ModForumToggleFavouriteStateResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumToggleFavouriteStateResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_toggle_favourite_state_with_http_info(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="The discussion to subscribe or unsubscribe")],
        targetstate: Annotated[Optional[StrictBool], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumToggleFavouriteStateResponse]:
        """Toggle the favourite state

        Toggle the favourite state

        :param discussionid: The discussion to subscribe or unsubscribe (required)
        :type discussionid: int
        :param targetstate: The target state (required)
        :type targetstate: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_toggle_favourite_state_serialize(
            discussionid=discussionid,
            targetstate=targetstate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumToggleFavouriteStateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_toggle_favourite_state_without_preload_content(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="The discussion to subscribe or unsubscribe")],
        targetstate: Annotated[Optional[StrictBool], Field(description="The target state")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Toggle the favourite state

        Toggle the favourite state

        :param discussionid: The discussion to subscribe or unsubscribe (required)
        :type discussionid: int
        :param targetstate: The target state (required)
        :type targetstate: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_toggle_favourite_state_serialize(
            discussionid=discussionid,
            targetstate=targetstate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumToggleFavouriteStateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_toggle_favourite_state_serialize(
        self,
        discussionid,
        targetstate,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_toggle_favourite_state'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_toggle_favourite_state'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_toggle_favourite_state',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if discussionid is not None:
            _form_params += parse_form({'discussionid': discussionid})
        if targetstate is not None:
            _form_params += parse_form({'targetstate': targetstate})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_update_discussion_post_args(
        self,
        postid: Annotated[Optional[StrictInt], Field(description="Post to be updated. It can be a discussion topic post.")],
        message: Annotated[Optional[StrictStr], Field(description="Updated post message (HTML assumed if messageformat is not provided)")] = None,
        messageformat: Annotated[Optional[StrictInt], Field(description="message format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")] = None,
        options: Annotated[Optional[List[ModForumUpdateDiscussionPostParametersOptionsInner]], Field(description="Configuration options for the post.")] = None,
        subject: Annotated[Optional[StrictStr], Field(description="Updated post subject")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Updates a post or a discussion topic post.

        Updates a post or a discussion topic post.

        :param postid: Post to be updated. It can be a discussion topic post. (required)
        :type postid: int
        :param message: Updated post message (HTML assumed if messageformat is not provided)
        :type message: str
        :param messageformat: message format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)
        :type messageformat: int
        :param options: Configuration options for the post.
        :type options: List[ModForumUpdateDiscussionPostParametersOptionsInner]
        :param subject: Updated post subject
        :type subject: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_update_discussion_post_serialize(
            postid=postid,
            message=message,
            messageformat=messageformat,
            options=options,
            subject=subject,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumUpdateDiscussionPostResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_update_discussion_post(
        self,
        postid: Annotated[Optional[StrictInt], Field(description="Post to be updated. It can be a discussion topic post.")],
        message: Annotated[Optional[StrictStr], Field(description="Updated post message (HTML assumed if messageformat is not provided)")] = None,
        messageformat: Annotated[Optional[StrictInt], Field(description="message format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")] = None,
        options: Annotated[Optional[List[ModForumUpdateDiscussionPostParametersOptionsInner]], Field(description="Configuration options for the post.")] = None,
        subject: Annotated[Optional[StrictStr], Field(description="Updated post subject")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumUpdateDiscussionPostResponse:
        """Updates a post or a discussion topic post.

        Updates a post or a discussion topic post.

        :param postid: Post to be updated. It can be a discussion topic post. (required)
        :type postid: int
        :param message: Updated post message (HTML assumed if messageformat is not provided)
        :type message: str
        :param messageformat: message format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)
        :type messageformat: int
        :param options: Configuration options for the post.
        :type options: List[ModForumUpdateDiscussionPostParametersOptionsInner]
        :param subject: Updated post subject
        :type subject: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_update_discussion_post_serialize(
            postid=postid,
            message=message,
            messageformat=messageformat,
            options=options,
            subject=subject,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumUpdateDiscussionPostResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_update_discussion_post_from_args(
        self,
        args
    ) -> ModForumUpdateDiscussionPostResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumUpdateDiscussionPostResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_update_discussion_post_with_http_info(
        self,
        postid: Annotated[Optional[StrictInt], Field(description="Post to be updated. It can be a discussion topic post.")],
        message: Annotated[Optional[StrictStr], Field(description="Updated post message (HTML assumed if messageformat is not provided)")] = None,
        messageformat: Annotated[Optional[StrictInt], Field(description="message format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")] = None,
        options: Annotated[Optional[List[ModForumUpdateDiscussionPostParametersOptionsInner]], Field(description="Configuration options for the post.")] = None,
        subject: Annotated[Optional[StrictStr], Field(description="Updated post subject")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumUpdateDiscussionPostResponse]:
        """Updates a post or a discussion topic post.

        Updates a post or a discussion topic post.

        :param postid: Post to be updated. It can be a discussion topic post. (required)
        :type postid: int
        :param message: Updated post message (HTML assumed if messageformat is not provided)
        :type message: str
        :param messageformat: message format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)
        :type messageformat: int
        :param options: Configuration options for the post.
        :type options: List[ModForumUpdateDiscussionPostParametersOptionsInner]
        :param subject: Updated post subject
        :type subject: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_update_discussion_post_serialize(
            postid=postid,
            message=message,
            messageformat=messageformat,
            options=options,
            subject=subject,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumUpdateDiscussionPostResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_update_discussion_post_without_preload_content(
        self,
        postid: Annotated[Optional[StrictInt], Field(description="Post to be updated. It can be a discussion topic post.")],
        message: Annotated[Optional[StrictStr], Field(description="Updated post message (HTML assumed if messageformat is not provided)")] = None,
        messageformat: Annotated[Optional[StrictInt], Field(description="message format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")] = None,
        options: Annotated[Optional[List[ModForumUpdateDiscussionPostParametersOptionsInner]], Field(description="Configuration options for the post.")] = None,
        subject: Annotated[Optional[StrictStr], Field(description="Updated post subject")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Updates a post or a discussion topic post.

        Updates a post or a discussion topic post.

        :param postid: Post to be updated. It can be a discussion topic post. (required)
        :type postid: int
        :param message: Updated post message (HTML assumed if messageformat is not provided)
        :type message: str
        :param messageformat: message format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)
        :type messageformat: int
        :param options: Configuration options for the post.
        :type options: List[ModForumUpdateDiscussionPostParametersOptionsInner]
        :param subject: Updated post subject
        :type subject: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_update_discussion_post_serialize(
            postid=postid,
            message=message,
            messageformat=messageformat,
            options=options,
            subject=subject,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumUpdateDiscussionPostResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_update_discussion_post_serialize(
        self,
        postid,
        message,
        messageformat,
        options,
        subject,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'options': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_update_discussion_post'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_update_discussion_post'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_update_discussion_post',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if message is not None:
            _form_params += parse_form({'message': message})
        if messageformat is not None:
            _form_params += parse_form({'messageformat': messageformat})
        if options is not None:
            _form_params += parse_form({'options': options})
        if postid is not None:
            _form_params += parse_form({'postid': postid})
        if subject is not None:
            _form_params += parse_form({'subject': subject})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_view_forum_args(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="forum instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param forumid: forum instance id (required)
        :type forumid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_view_forum_serialize(
            forumid=forumid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumViewForumResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_view_forum(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="forum instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumViewForumResponse:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param forumid: forum instance id (required)
        :type forumid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_view_forum_serialize(
            forumid=forumid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumViewForumResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_view_forum_from_args(
        self,
        args
    ) -> ModForumViewForumResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumViewForumResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_view_forum_with_http_info(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="forum instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumViewForumResponse]:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param forumid: forum instance id (required)
        :type forumid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_view_forum_serialize(
            forumid=forumid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumViewForumResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_view_forum_without_preload_content(
        self,
        forumid: Annotated[Optional[StrictInt], Field(description="forum instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param forumid: forum instance id (required)
        :type forumid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_view_forum_serialize(
            forumid=forumid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumViewForumResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_view_forum_serialize(
        self,
        forumid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_view_forum'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_view_forum'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_view_forum',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if forumid is not None:
            _form_params += parse_form({'forumid': forumid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_forum_view_forum_discussion_args(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="discussion id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the forum discussion viewed event.

        Trigger the forum discussion viewed event.

        :param discussionid: discussion id (required)
        :type discussionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_view_forum_discussion_serialize(
            discussionid=discussionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumViewForumDiscussionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_forum_view_forum_discussion(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="discussion id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModForumViewForumDiscussionResponse:
        """Trigger the forum discussion viewed event.

        Trigger the forum discussion viewed event.

        :param discussionid: discussion id (required)
        :type discussionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_view_forum_discussion_serialize(
            discussionid=discussionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumViewForumDiscussionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_view_forum_discussion_from_args(
        self,
        args
    ) -> ModForumViewForumDiscussionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumViewForumDiscussionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_forum_view_forum_discussion_with_http_info(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="discussion id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModForumViewForumDiscussionResponse]:
        """Trigger the forum discussion viewed event.

        Trigger the forum discussion viewed event.

        :param discussionid: discussion id (required)
        :type discussionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_view_forum_discussion_serialize(
            discussionid=discussionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumViewForumDiscussionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_forum_view_forum_discussion_without_preload_content(
        self,
        discussionid: Annotated[Optional[StrictInt], Field(description="discussion id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the forum discussion viewed event.

        Trigger the forum discussion viewed event.

        :param discussionid: discussion id (required)
        :type discussionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_forum_view_forum_discussion_serialize(
            discussionid=discussionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModForumViewForumDiscussionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_forum_view_forum_discussion_serialize(
        self,
        discussionid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_forum_view_forum_discussion'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_forum_view_forum_discussion'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_forum_view_forum_discussion',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if discussionid is not None:
            _form_params += parse_form({'discussionid': discussionid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_add_entry_args(
        self,
        concept: Annotated[Optional[StrictStr], Field(description="Glossary concept")],
        definition: Annotated[Optional[StrictStr], Field(description="Glossary concept definition")],
        definitionformat: Annotated[Optional[StrictInt], Field(description="definition format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")],
        glossaryid: Annotated[Optional[StrictInt], Field(description="Glossary id")],
        options: Annotated[Optional[List[ModGlossaryAddEntryParametersOptionsInner]], Field(description="Optional settings")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Add a new entry to a given glossary

        Add a new entry to a given glossary

        :param concept: Glossary concept (required)
        :type concept: str
        :param definition: Glossary concept definition (required)
        :type definition: str
        :param definitionformat: definition format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN) (required)
        :type definitionformat: int
        :param glossaryid: Glossary id (required)
        :type glossaryid: int
        :param options: Optional settings
        :type options: List[ModGlossaryAddEntryParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_add_entry_serialize(
            concept=concept,
            definition=definition,
            definitionformat=definitionformat,
            glossaryid=glossaryid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryAddEntryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_add_entry(
        self,
        concept: Annotated[Optional[StrictStr], Field(description="Glossary concept")],
        definition: Annotated[Optional[StrictStr], Field(description="Glossary concept definition")],
        definitionformat: Annotated[Optional[StrictInt], Field(description="definition format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")],
        glossaryid: Annotated[Optional[StrictInt], Field(description="Glossary id")],
        options: Annotated[Optional[List[ModGlossaryAddEntryParametersOptionsInner]], Field(description="Optional settings")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryAddEntryResponse:
        """Add a new entry to a given glossary

        Add a new entry to a given glossary

        :param concept: Glossary concept (required)
        :type concept: str
        :param definition: Glossary concept definition (required)
        :type definition: str
        :param definitionformat: definition format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN) (required)
        :type definitionformat: int
        :param glossaryid: Glossary id (required)
        :type glossaryid: int
        :param options: Optional settings
        :type options: List[ModGlossaryAddEntryParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_add_entry_serialize(
            concept=concept,
            definition=definition,
            definitionformat=definitionformat,
            glossaryid=glossaryid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryAddEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_add_entry_from_args(
        self,
        args
    ) -> ModGlossaryAddEntryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryAddEntryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_add_entry_with_http_info(
        self,
        concept: Annotated[Optional[StrictStr], Field(description="Glossary concept")],
        definition: Annotated[Optional[StrictStr], Field(description="Glossary concept definition")],
        definitionformat: Annotated[Optional[StrictInt], Field(description="definition format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")],
        glossaryid: Annotated[Optional[StrictInt], Field(description="Glossary id")],
        options: Annotated[Optional[List[ModGlossaryAddEntryParametersOptionsInner]], Field(description="Optional settings")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryAddEntryResponse]:
        """Add a new entry to a given glossary

        Add a new entry to a given glossary

        :param concept: Glossary concept (required)
        :type concept: str
        :param definition: Glossary concept definition (required)
        :type definition: str
        :param definitionformat: definition format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN) (required)
        :type definitionformat: int
        :param glossaryid: Glossary id (required)
        :type glossaryid: int
        :param options: Optional settings
        :type options: List[ModGlossaryAddEntryParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_add_entry_serialize(
            concept=concept,
            definition=definition,
            definitionformat=definitionformat,
            glossaryid=glossaryid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryAddEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_add_entry_without_preload_content(
        self,
        concept: Annotated[Optional[StrictStr], Field(description="Glossary concept")],
        definition: Annotated[Optional[StrictStr], Field(description="Glossary concept definition")],
        definitionformat: Annotated[Optional[StrictInt], Field(description="definition format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")],
        glossaryid: Annotated[Optional[StrictInt], Field(description="Glossary id")],
        options: Annotated[Optional[List[ModGlossaryAddEntryParametersOptionsInner]], Field(description="Optional settings")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Add a new entry to a given glossary

        Add a new entry to a given glossary

        :param concept: Glossary concept (required)
        :type concept: str
        :param definition: Glossary concept definition (required)
        :type definition: str
        :param definitionformat: definition format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN) (required)
        :type definitionformat: int
        :param glossaryid: Glossary id (required)
        :type glossaryid: int
        :param options: Optional settings
        :type options: List[ModGlossaryAddEntryParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_add_entry_serialize(
            concept=concept,
            definition=definition,
            definitionformat=definitionformat,
            glossaryid=glossaryid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryAddEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_add_entry_serialize(
        self,
        concept,
        definition,
        definitionformat,
        glossaryid,
        options,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'options': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_add_entry'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_add_entry'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_add_entry',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if concept is not None:
            _form_params += parse_form({'concept': concept})
        if definition is not None:
            _form_params += parse_form({'definition': definition})
        if definitionformat is not None:
            _form_params += parse_form({'definitionformat': definitionformat})
        if glossaryid is not None:
            _form_params += parse_form({'glossaryid': glossaryid})
        if options is not None:
            _form_params += parse_form({'options': options})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_delete_entry_args(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Glossary entry id to delete")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete the given entry from the glossary.

        Delete the given entry from the glossary.

        :param entryid: Glossary entry id to delete (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_delete_entry_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryDeleteEntryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_delete_entry(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Glossary entry id to delete")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryDeleteEntryResponse:
        """Delete the given entry from the glossary.

        Delete the given entry from the glossary.

        :param entryid: Glossary entry id to delete (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_delete_entry_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryDeleteEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_delete_entry_from_args(
        self,
        args
    ) -> ModGlossaryDeleteEntryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryDeleteEntryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_delete_entry_with_http_info(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Glossary entry id to delete")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryDeleteEntryResponse]:
        """Delete the given entry from the glossary.

        Delete the given entry from the glossary.

        :param entryid: Glossary entry id to delete (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_delete_entry_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryDeleteEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_delete_entry_without_preload_content(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Glossary entry id to delete")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete the given entry from the glossary.

        Delete the given entry from the glossary.

        :param entryid: Glossary entry id to delete (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_delete_entry_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryDeleteEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_delete_entry_serialize(
        self,
        entryid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_delete_entry'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_delete_entry'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_delete_entry',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if entryid is not None:
            _form_params += parse_form({'entryid': entryid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_get_authors_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetAuthorsParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the authors.

        Get the authors.

        :param id: Glossary entry ID (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetAuthorsParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_authors_serialize(
            id=id,
            var_from=var_from,
            limit=limit,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetAuthorsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_get_authors(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetAuthorsParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryGetAuthorsResponse:
        """Get the authors.

        Get the authors.

        :param id: Glossary entry ID (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetAuthorsParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_authors_serialize(
            id=id,
            var_from=var_from,
            limit=limit,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetAuthorsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_authors_from_args(
        self,
        args
    ) -> ModGlossaryGetAuthorsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetAuthorsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_authors_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetAuthorsParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryGetAuthorsResponse]:
        """Get the authors.

        Get the authors.

        :param id: Glossary entry ID (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetAuthorsParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_authors_serialize(
            id=id,
            var_from=var_from,
            limit=limit,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetAuthorsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_get_authors_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetAuthorsParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the authors.

        Get the authors.

        :param id: Glossary entry ID (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetAuthorsParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_authors_serialize(
            id=id,
            var_from=var_from,
            limit=limit,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetAuthorsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_get_authors_serialize(
        self,
        id,
        var_from,
        limit,
        options,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_get_authors'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_get_authors'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_get_authors',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if var_from is not None:
            _form_params += parse_form({'from': var_from})
        if id is not None:
            _form_params += parse_form({'id': id})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if options is not None:
            _form_params += parse_form({'options': options})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_get_categories_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The glossary ID")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the categories.

        Get the categories.

        :param id: The glossary ID (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_categories_serialize(
            id=id,
            var_from=var_from,
            limit=limit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetCategoriesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_get_categories(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The glossary ID")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryGetCategoriesResponse:
        """Get the categories.

        Get the categories.

        :param id: The glossary ID (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_categories_serialize(
            id=id,
            var_from=var_from,
            limit=limit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetCategoriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_categories_from_args(
        self,
        args
    ) -> ModGlossaryGetCategoriesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetCategoriesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_categories_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The glossary ID")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryGetCategoriesResponse]:
        """Get the categories.

        Get the categories.

        :param id: The glossary ID (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_categories_serialize(
            id=id,
            var_from=var_from,
            limit=limit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetCategoriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_get_categories_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The glossary ID")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the categories.

        Get the categories.

        :param id: The glossary ID (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_categories_serialize(
            id=id,
            var_from=var_from,
            limit=limit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetCategoriesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_get_categories_serialize(
        self,
        id,
        var_from,
        limit,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_get_categories'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_get_categories'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_get_categories',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if var_from is not None:
            _form_params += parse_form({'from': var_from})
        if id is not None:
            _form_params += parse_form({'id': id})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_get_entries_by_author_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        letter: Annotated[Optional[StrictStr], Field(description="First letter of firstname or lastname, or either keywords: 'ALL' or 'SPECIAL'.")],
        var_field: Annotated[Optional[StrictStr], Field(description="Search and order using: 'FIRSTNAME' or 'LASTNAME'")] = None,
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Browse entries by author.

        Browse entries by author.

        :param id: Glossary entry ID (required)
        :type id: int
        :param letter: First letter of firstname or lastname, or either keywords: 'ALL' or 'SPECIAL'. (required)
        :type letter: str
        :param var_field: Search and order using: 'FIRSTNAME' or 'LASTNAME'
        :type var_field: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_author_serialize(
            id=id,
            letter=letter,
            var_field=var_field,
            var_from=var_from,
            limit=limit,
            options=options,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByAuthorResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_get_entries_by_author(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        letter: Annotated[Optional[StrictStr], Field(description="First letter of firstname or lastname, or either keywords: 'ALL' or 'SPECIAL'.")],
        var_field: Annotated[Optional[StrictStr], Field(description="Search and order using: 'FIRSTNAME' or 'LASTNAME'")] = None,
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryGetEntriesByAuthorResponse:
        """Browse entries by author.

        Browse entries by author.

        :param id: Glossary entry ID (required)
        :type id: int
        :param letter: First letter of firstname or lastname, or either keywords: 'ALL' or 'SPECIAL'. (required)
        :type letter: str
        :param var_field: Search and order using: 'FIRSTNAME' or 'LASTNAME'
        :type var_field: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_author_serialize(
            id=id,
            letter=letter,
            var_field=var_field,
            var_from=var_from,
            limit=limit,
            options=options,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByAuthorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entries_by_author_from_args(
        self,
        args
    ) -> ModGlossaryGetEntriesByAuthorResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByAuthorResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entries_by_author_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        letter: Annotated[Optional[StrictStr], Field(description="First letter of firstname or lastname, or either keywords: 'ALL' or 'SPECIAL'.")],
        var_field: Annotated[Optional[StrictStr], Field(description="Search and order using: 'FIRSTNAME' or 'LASTNAME'")] = None,
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryGetEntriesByAuthorResponse]:
        """Browse entries by author.

        Browse entries by author.

        :param id: Glossary entry ID (required)
        :type id: int
        :param letter: First letter of firstname or lastname, or either keywords: 'ALL' or 'SPECIAL'. (required)
        :type letter: str
        :param var_field: Search and order using: 'FIRSTNAME' or 'LASTNAME'
        :type var_field: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_author_serialize(
            id=id,
            letter=letter,
            var_field=var_field,
            var_from=var_from,
            limit=limit,
            options=options,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByAuthorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_get_entries_by_author_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        letter: Annotated[Optional[StrictStr], Field(description="First letter of firstname or lastname, or either keywords: 'ALL' or 'SPECIAL'.")],
        var_field: Annotated[Optional[StrictStr], Field(description="Search and order using: 'FIRSTNAME' or 'LASTNAME'")] = None,
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Browse entries by author.

        Browse entries by author.

        :param id: Glossary entry ID (required)
        :type id: int
        :param letter: First letter of firstname or lastname, or either keywords: 'ALL' or 'SPECIAL'. (required)
        :type letter: str
        :param var_field: Search and order using: 'FIRSTNAME' or 'LASTNAME'
        :type var_field: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_author_serialize(
            id=id,
            letter=letter,
            var_field=var_field,
            var_from=var_from,
            limit=limit,
            options=options,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByAuthorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_get_entries_by_author_serialize(
        self,
        id,
        letter,
        var_field,
        var_from,
        limit,
        options,
        sort,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_get_entries_by_author'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_get_entries_by_author'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_get_entries_by_author',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if var_field is not None:
            _form_params += parse_form({'field': var_field})
        if var_from is not None:
            _form_params += parse_form({'from': var_from})
        if id is not None:
            _form_params += parse_form({'id': id})
        if letter is not None:
            _form_params += parse_form({'letter': letter})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if options is not None:
            _form_params += parse_form({'options': options})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_get_entries_by_author_id_args(
        self,
        authorid: Annotated[Optional[StrictInt], Field(description="The author ID")],
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        order: Annotated[Optional[StrictStr], Field(description="Order by: 'CONCEPT', 'CREATION' or 'UPDATE'")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Browse entries by author ID.

        Browse entries by author ID.

        :param authorid: The author ID (required)
        :type authorid: int
        :param id: Glossary entry ID (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param order: Order by: 'CONCEPT', 'CREATION' or 'UPDATE'
        :type order: str
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_author_id_serialize(
            authorid=authorid,
            id=id,
            var_from=var_from,
            limit=limit,
            options=options,
            order=order,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByAuthorIdResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_get_entries_by_author_id(
        self,
        authorid: Annotated[Optional[StrictInt], Field(description="The author ID")],
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        order: Annotated[Optional[StrictStr], Field(description="Order by: 'CONCEPT', 'CREATION' or 'UPDATE'")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryGetEntriesByAuthorIdResponse:
        """Browse entries by author ID.

        Browse entries by author ID.

        :param authorid: The author ID (required)
        :type authorid: int
        :param id: Glossary entry ID (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param order: Order by: 'CONCEPT', 'CREATION' or 'UPDATE'
        :type order: str
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_author_id_serialize(
            authorid=authorid,
            id=id,
            var_from=var_from,
            limit=limit,
            options=options,
            order=order,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByAuthorIdResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entries_by_author_id_from_args(
        self,
        args
    ) -> ModGlossaryGetEntriesByAuthorIdResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByAuthorIdResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entries_by_author_id_with_http_info(
        self,
        authorid: Annotated[Optional[StrictInt], Field(description="The author ID")],
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        order: Annotated[Optional[StrictStr], Field(description="Order by: 'CONCEPT', 'CREATION' or 'UPDATE'")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryGetEntriesByAuthorIdResponse]:
        """Browse entries by author ID.

        Browse entries by author ID.

        :param authorid: The author ID (required)
        :type authorid: int
        :param id: Glossary entry ID (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param order: Order by: 'CONCEPT', 'CREATION' or 'UPDATE'
        :type order: str
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_author_id_serialize(
            authorid=authorid,
            id=id,
            var_from=var_from,
            limit=limit,
            options=options,
            order=order,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByAuthorIdResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_get_entries_by_author_id_without_preload_content(
        self,
        authorid: Annotated[Optional[StrictInt], Field(description="The author ID")],
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        order: Annotated[Optional[StrictStr], Field(description="Order by: 'CONCEPT', 'CREATION' or 'UPDATE'")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Browse entries by author ID.

        Browse entries by author ID.

        :param authorid: The author ID (required)
        :type authorid: int
        :param id: Glossary entry ID (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param order: Order by: 'CONCEPT', 'CREATION' or 'UPDATE'
        :type order: str
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_author_id_serialize(
            authorid=authorid,
            id=id,
            var_from=var_from,
            limit=limit,
            options=options,
            order=order,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByAuthorIdResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_get_entries_by_author_id_serialize(
        self,
        authorid,
        id,
        var_from,
        limit,
        options,
        order,
        sort,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_get_entries_by_author_id'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_get_entries_by_author_id'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_get_entries_by_author_id',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if authorid is not None:
            _form_params += parse_form({'authorid': authorid})
        if var_from is not None:
            _form_params += parse_form({'from': var_from})
        if id is not None:
            _form_params += parse_form({'id': id})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if options is not None:
            _form_params += parse_form({'options': options})
        if order is not None:
            _form_params += parse_form({'order': order})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_get_entries_by_category_args(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="The category ID. Use '0' for all categories, or '-1' for uncategorised entries.")],
        id: Annotated[Optional[StrictInt], Field(description="The glossary ID.")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Browse entries by category.

        Browse entries by category.

        :param categoryid: The category ID. Use '0' for all categories, or '-1' for uncategorised entries. (required)
        :type categoryid: int
        :param id: The glossary ID. (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_category_serialize(
            categoryid=categoryid,
            id=id,
            var_from=var_from,
            limit=limit,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByCategoryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_get_entries_by_category(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="The category ID. Use '0' for all categories, or '-1' for uncategorised entries.")],
        id: Annotated[Optional[StrictInt], Field(description="The glossary ID.")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryGetEntriesByCategoryResponse:
        """Browse entries by category.

        Browse entries by category.

        :param categoryid: The category ID. Use '0' for all categories, or '-1' for uncategorised entries. (required)
        :type categoryid: int
        :param id: The glossary ID. (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_category_serialize(
            categoryid=categoryid,
            id=id,
            var_from=var_from,
            limit=limit,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByCategoryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entries_by_category_from_args(
        self,
        args
    ) -> ModGlossaryGetEntriesByCategoryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByCategoryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entries_by_category_with_http_info(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="The category ID. Use '0' for all categories, or '-1' for uncategorised entries.")],
        id: Annotated[Optional[StrictInt], Field(description="The glossary ID.")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryGetEntriesByCategoryResponse]:
        """Browse entries by category.

        Browse entries by category.

        :param categoryid: The category ID. Use '0' for all categories, or '-1' for uncategorised entries. (required)
        :type categoryid: int
        :param id: The glossary ID. (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_category_serialize(
            categoryid=categoryid,
            id=id,
            var_from=var_from,
            limit=limit,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByCategoryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_get_entries_by_category_without_preload_content(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="The category ID. Use '0' for all categories, or '-1' for uncategorised entries.")],
        id: Annotated[Optional[StrictInt], Field(description="The glossary ID.")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Browse entries by category.

        Browse entries by category.

        :param categoryid: The category ID. Use '0' for all categories, or '-1' for uncategorised entries. (required)
        :type categoryid: int
        :param id: The glossary ID. (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_category_serialize(
            categoryid=categoryid,
            id=id,
            var_from=var_from,
            limit=limit,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByCategoryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_get_entries_by_category_serialize(
        self,
        categoryid,
        id,
        var_from,
        limit,
        options,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_get_entries_by_category'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_get_entries_by_category'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_get_entries_by_category',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if categoryid is not None:
            _form_params += parse_form({'categoryid': categoryid})
        if var_from is not None:
            _form_params += parse_form({'from': var_from})
        if id is not None:
            _form_params += parse_form({'id': id})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if options is not None:
            _form_params += parse_form({'options': options})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_get_entries_by_date_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        order: Annotated[Optional[StrictStr], Field(description="Order the records by: 'CREATION' or 'UPDATE'.")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Browse entries by date.

        Browse entries by date.

        :param id: Glossary entry ID (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param order: Order the records by: 'CREATION' or 'UPDATE'.
        :type order: str
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_date_serialize(
            id=id,
            var_from=var_from,
            limit=limit,
            options=options,
            order=order,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByDateResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_get_entries_by_date(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        order: Annotated[Optional[StrictStr], Field(description="Order the records by: 'CREATION' or 'UPDATE'.")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryGetEntriesByDateResponse:
        """Browse entries by date.

        Browse entries by date.

        :param id: Glossary entry ID (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param order: Order the records by: 'CREATION' or 'UPDATE'.
        :type order: str
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_date_serialize(
            id=id,
            var_from=var_from,
            limit=limit,
            options=options,
            order=order,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByDateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entries_by_date_from_args(
        self,
        args
    ) -> ModGlossaryGetEntriesByDateResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByDateResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entries_by_date_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        order: Annotated[Optional[StrictStr], Field(description="Order the records by: 'CREATION' or 'UPDATE'.")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryGetEntriesByDateResponse]:
        """Browse entries by date.

        Browse entries by date.

        :param id: Glossary entry ID (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param order: Order the records by: 'CREATION' or 'UPDATE'.
        :type order: str
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_date_serialize(
            id=id,
            var_from=var_from,
            limit=limit,
            options=options,
            order=order,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByDateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_get_entries_by_date_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        order: Annotated[Optional[StrictStr], Field(description="Order the records by: 'CREATION' or 'UPDATE'.")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Browse entries by date.

        Browse entries by date.

        :param id: Glossary entry ID (required)
        :type id: int
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param order: Order the records by: 'CREATION' or 'UPDATE'.
        :type order: str
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_date_serialize(
            id=id,
            var_from=var_from,
            limit=limit,
            options=options,
            order=order,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByDateResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_get_entries_by_date_serialize(
        self,
        id,
        var_from,
        limit,
        options,
        order,
        sort,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_get_entries_by_date'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_get_entries_by_date'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_get_entries_by_date',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if var_from is not None:
            _form_params += parse_form({'from': var_from})
        if id is not None:
            _form_params += parse_form({'id': id})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if options is not None:
            _form_params += parse_form({'options': options})
        if order is not None:
            _form_params += parse_form({'order': order})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_get_entries_by_letter_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        letter: Annotated[Optional[StrictStr], Field(description="A letter, or either keywords: 'ALL' or 'SPECIAL'.")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Browse entries by letter.

        Browse entries by letter.

        :param id: Glossary entry ID (required)
        :type id: int
        :param letter: A letter, or either keywords: 'ALL' or 'SPECIAL'. (required)
        :type letter: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_letter_serialize(
            id=id,
            letter=letter,
            var_from=var_from,
            limit=limit,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByLetterResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_get_entries_by_letter(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        letter: Annotated[Optional[StrictStr], Field(description="A letter, or either keywords: 'ALL' or 'SPECIAL'.")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryGetEntriesByLetterResponse:
        """Browse entries by letter.

        Browse entries by letter.

        :param id: Glossary entry ID (required)
        :type id: int
        :param letter: A letter, or either keywords: 'ALL' or 'SPECIAL'. (required)
        :type letter: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_letter_serialize(
            id=id,
            letter=letter,
            var_from=var_from,
            limit=limit,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByLetterResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entries_by_letter_from_args(
        self,
        args
    ) -> ModGlossaryGetEntriesByLetterResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByLetterResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entries_by_letter_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        letter: Annotated[Optional[StrictStr], Field(description="A letter, or either keywords: 'ALL' or 'SPECIAL'.")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryGetEntriesByLetterResponse]:
        """Browse entries by letter.

        Browse entries by letter.

        :param id: Glossary entry ID (required)
        :type id: int
        :param letter: A letter, or either keywords: 'ALL' or 'SPECIAL'. (required)
        :type letter: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_letter_serialize(
            id=id,
            letter=letter,
            var_from=var_from,
            limit=limit,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByLetterResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_get_entries_by_letter_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        letter: Annotated[Optional[StrictStr], Field(description="A letter, or either keywords: 'ALL' or 'SPECIAL'.")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Browse entries by letter.

        Browse entries by letter.

        :param id: Glossary entry ID (required)
        :type id: int
        :param letter: A letter, or either keywords: 'ALL' or 'SPECIAL'. (required)
        :type letter: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_letter_serialize(
            id=id,
            letter=letter,
            var_from=var_from,
            limit=limit,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByLetterResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_get_entries_by_letter_serialize(
        self,
        id,
        letter,
        var_from,
        limit,
        options,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_get_entries_by_letter'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_get_entries_by_letter'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_get_entries_by_letter',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if var_from is not None:
            _form_params += parse_form({'from': var_from})
        if id is not None:
            _form_params += parse_form({'id': id})
        if letter is not None:
            _form_params += parse_form({'letter': letter})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if options is not None:
            _form_params += parse_form({'options': options})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_get_entries_by_search_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        query: Annotated[Optional[StrictStr], Field(description="The query string")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        fullsearch: Annotated[Optional[StrictBool], Field(description="The query")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        order: Annotated[Optional[StrictStr], Field(description="Order by: 'CONCEPT', 'CREATION' or 'UPDATE'")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Browse entries by search query.

        Browse entries by search query.

        :param id: Glossary entry ID (required)
        :type id: int
        :param query: The query string (required)
        :type query: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param fullsearch: The query
        :type fullsearch: bool
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param order: Order by: 'CONCEPT', 'CREATION' or 'UPDATE'
        :type order: str
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_search_serialize(
            id=id,
            query=query,
            var_from=var_from,
            fullsearch=fullsearch,
            limit=limit,
            options=options,
            order=order,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesBySearchResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_get_entries_by_search(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        query: Annotated[Optional[StrictStr], Field(description="The query string")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        fullsearch: Annotated[Optional[StrictBool], Field(description="The query")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        order: Annotated[Optional[StrictStr], Field(description="Order by: 'CONCEPT', 'CREATION' or 'UPDATE'")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryGetEntriesBySearchResponse:
        """Browse entries by search query.

        Browse entries by search query.

        :param id: Glossary entry ID (required)
        :type id: int
        :param query: The query string (required)
        :type query: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param fullsearch: The query
        :type fullsearch: bool
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param order: Order by: 'CONCEPT', 'CREATION' or 'UPDATE'
        :type order: str
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_search_serialize(
            id=id,
            query=query,
            var_from=var_from,
            fullsearch=fullsearch,
            limit=limit,
            options=options,
            order=order,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesBySearchResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entries_by_search_from_args(
        self,
        args
    ) -> ModGlossaryGetEntriesBySearchResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesBySearchResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entries_by_search_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        query: Annotated[Optional[StrictStr], Field(description="The query string")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        fullsearch: Annotated[Optional[StrictBool], Field(description="The query")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        order: Annotated[Optional[StrictStr], Field(description="Order by: 'CONCEPT', 'CREATION' or 'UPDATE'")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryGetEntriesBySearchResponse]:
        """Browse entries by search query.

        Browse entries by search query.

        :param id: Glossary entry ID (required)
        :type id: int
        :param query: The query string (required)
        :type query: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param fullsearch: The query
        :type fullsearch: bool
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param order: Order by: 'CONCEPT', 'CREATION' or 'UPDATE'
        :type order: str
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_search_serialize(
            id=id,
            query=query,
            var_from=var_from,
            fullsearch=fullsearch,
            limit=limit,
            options=options,
            order=order,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesBySearchResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_get_entries_by_search_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        query: Annotated[Optional[StrictStr], Field(description="The query string")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        fullsearch: Annotated[Optional[StrictBool], Field(description="The query")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        order: Annotated[Optional[StrictStr], Field(description="Order by: 'CONCEPT', 'CREATION' or 'UPDATE'")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Browse entries by search query.

        Browse entries by search query.

        :param id: Glossary entry ID (required)
        :type id: int
        :param query: The query string (required)
        :type query: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param fullsearch: The query
        :type fullsearch: bool
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param order: Order by: 'CONCEPT', 'CREATION' or 'UPDATE'
        :type order: str
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_search_serialize(
            id=id,
            query=query,
            var_from=var_from,
            fullsearch=fullsearch,
            limit=limit,
            options=options,
            order=order,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesBySearchResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_get_entries_by_search_serialize(
        self,
        id,
        query,
        var_from,
        fullsearch,
        limit,
        options,
        order,
        sort,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_get_entries_by_search'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_get_entries_by_search'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_get_entries_by_search',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if var_from is not None:
            _form_params += parse_form({'from': var_from})
        if fullsearch is not None:
            _form_params += parse_form({'fullsearch': fullsearch})
        if id is not None:
            _form_params += parse_form({'id': id})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if options is not None:
            _form_params += parse_form({'options': options})
        if order is not None:
            _form_params += parse_form({'order': order})
        if query is not None:
            _form_params += parse_form({'query': query})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_get_entries_by_term_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        term: Annotated[Optional[StrictStr], Field(description="The entry concept, or alias")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Browse entries by term (concept or alias).

        Browse entries by term (concept or alias).

        :param id: Glossary entry ID (required)
        :type id: int
        :param term: The entry concept, or alias (required)
        :type term: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_term_serialize(
            id=id,
            term=term,
            var_from=var_from,
            limit=limit,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByTermResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_get_entries_by_term(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        term: Annotated[Optional[StrictStr], Field(description="The entry concept, or alias")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryGetEntriesByTermResponse:
        """Browse entries by term (concept or alias).

        Browse entries by term (concept or alias).

        :param id: Glossary entry ID (required)
        :type id: int
        :param term: The entry concept, or alias (required)
        :type term: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_term_serialize(
            id=id,
            term=term,
            var_from=var_from,
            limit=limit,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByTermResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entries_by_term_from_args(
        self,
        args
    ) -> ModGlossaryGetEntriesByTermResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByTermResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entries_by_term_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        term: Annotated[Optional[StrictStr], Field(description="The entry concept, or alias")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryGetEntriesByTermResponse]:
        """Browse entries by term (concept or alias).

        Browse entries by term (concept or alias).

        :param id: Glossary entry ID (required)
        :type id: int
        :param term: The entry concept, or alias (required)
        :type term: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_term_serialize(
            id=id,
            term=term,
            var_from=var_from,
            limit=limit,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByTermResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_get_entries_by_term_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        term: Annotated[Optional[StrictStr], Field(description="The entry concept, or alias")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Optional[ModGlossaryGetEntriesByAuthorIdParametersOptions] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Browse entries by term (concept or alias).

        Browse entries by term (concept or alias).

        :param id: Glossary entry ID (required)
        :type id: int
        :param term: The entry concept, or alias (required)
        :type term: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options:
        :type options: ModGlossaryGetEntriesByAuthorIdParametersOptions
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_by_term_serialize(
            id=id,
            term=term,
            var_from=var_from,
            limit=limit,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesByTermResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_get_entries_by_term_serialize(
        self,
        id,
        term,
        var_from,
        limit,
        options,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_get_entries_by_term'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_get_entries_by_term'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_get_entries_by_term',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if var_from is not None:
            _form_params += parse_form({'from': var_from})
        if id is not None:
            _form_params += parse_form({'id': id})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if options is not None:
            _form_params += parse_form({'options': options})
        if term is not None:
            _form_params += parse_form({'term': term})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_get_entries_to_approve_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        letter: Annotated[Optional[StrictStr], Field(description="A letter, or either keywords: 'ALL' or 'SPECIAL'.")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Annotated[Optional[Dict[str, Any]], Field(description="An array of options")] = None,
        order: Annotated[Optional[StrictStr], Field(description="Order by: 'CONCEPT', 'CREATION' or 'UPDATE'")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Browse entries to be approved.

        Browse entries to be approved.

        :param id: Glossary entry ID (required)
        :type id: int
        :param letter: A letter, or either keywords: 'ALL' or 'SPECIAL'. (required)
        :type letter: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options: An array of options
        :type options: object
        :param order: Order by: 'CONCEPT', 'CREATION' or 'UPDATE'
        :type order: str
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_to_approve_serialize(
            id=id,
            letter=letter,
            var_from=var_from,
            limit=limit,
            options=options,
            order=order,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesToApproveResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_get_entries_to_approve(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        letter: Annotated[Optional[StrictStr], Field(description="A letter, or either keywords: 'ALL' or 'SPECIAL'.")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Annotated[Optional[Dict[str, Any]], Field(description="An array of options")] = None,
        order: Annotated[Optional[StrictStr], Field(description="Order by: 'CONCEPT', 'CREATION' or 'UPDATE'")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryGetEntriesToApproveResponse:
        """Browse entries to be approved.

        Browse entries to be approved.

        :param id: Glossary entry ID (required)
        :type id: int
        :param letter: A letter, or either keywords: 'ALL' or 'SPECIAL'. (required)
        :type letter: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options: An array of options
        :type options: object
        :param order: Order by: 'CONCEPT', 'CREATION' or 'UPDATE'
        :type order: str
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_to_approve_serialize(
            id=id,
            letter=letter,
            var_from=var_from,
            limit=limit,
            options=options,
            order=order,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesToApproveResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entries_to_approve_from_args(
        self,
        args
    ) -> ModGlossaryGetEntriesToApproveResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesToApproveResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entries_to_approve_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        letter: Annotated[Optional[StrictStr], Field(description="A letter, or either keywords: 'ALL' or 'SPECIAL'.")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Annotated[Optional[Dict[str, Any]], Field(description="An array of options")] = None,
        order: Annotated[Optional[StrictStr], Field(description="Order by: 'CONCEPT', 'CREATION' or 'UPDATE'")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryGetEntriesToApproveResponse]:
        """Browse entries to be approved.

        Browse entries to be approved.

        :param id: Glossary entry ID (required)
        :type id: int
        :param letter: A letter, or either keywords: 'ALL' or 'SPECIAL'. (required)
        :type letter: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options: An array of options
        :type options: object
        :param order: Order by: 'CONCEPT', 'CREATION' or 'UPDATE'
        :type order: str
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_to_approve_serialize(
            id=id,
            letter=letter,
            var_from=var_from,
            limit=limit,
            options=options,
            order=order,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesToApproveResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_get_entries_to_approve_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        letter: Annotated[Optional[StrictStr], Field(description="A letter, or either keywords: 'ALL' or 'SPECIAL'.")],
        var_from: Annotated[Optional[StrictInt], Field(description="Start returning records from here")] = None,
        limit: Annotated[Optional[StrictInt], Field(description="Number of records to return")] = None,
        options: Annotated[Optional[Dict[str, Any]], Field(description="An array of options")] = None,
        order: Annotated[Optional[StrictStr], Field(description="Order by: 'CONCEPT', 'CREATION' or 'UPDATE'")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The direction of the order: 'ASC' or 'DESC'")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Browse entries to be approved.

        Browse entries to be approved.

        :param id: Glossary entry ID (required)
        :type id: int
        :param letter: A letter, or either keywords: 'ALL' or 'SPECIAL'. (required)
        :type letter: str
        :param var_from: Start returning records from here
        :type var_from: int
        :param limit: Number of records to return
        :type limit: int
        :param options: An array of options
        :type options: object
        :param order: Order by: 'CONCEPT', 'CREATION' or 'UPDATE'
        :type order: str
        :param sort: The direction of the order: 'ASC' or 'DESC'
        :type sort: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entries_to_approve_serialize(
            id=id,
            letter=letter,
            var_from=var_from,
            limit=limit,
            options=options,
            order=order,
            sort=sort,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntriesToApproveResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_get_entries_to_approve_serialize(
        self,
        id,
        letter,
        var_from,
        limit,
        options,
        order,
        sort,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_get_entries_to_approve'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_get_entries_to_approve'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_get_entries_to_approve',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if var_from is not None:
            _form_params += parse_form({'from': var_from})
        if id is not None:
            _form_params += parse_form({'id': id})
        if letter is not None:
            _form_params += parse_form({'letter': letter})
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if options is not None:
            _form_params += parse_form({'options': options})
        if order is not None:
            _form_params += parse_form({'order': order})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_get_entry_by_id_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get an entry by ID

        Get an entry by ID

        :param id: Glossary entry ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entry_by_id_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntryByIdResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_get_entry_by_id(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryGetEntryByIdResponse:
        """Get an entry by ID

        Get an entry by ID

        :param id: Glossary entry ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entry_by_id_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntryByIdResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entry_by_id_from_args(
        self,
        args
    ) -> ModGlossaryGetEntryByIdResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntryByIdResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_entry_by_id_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryGetEntryByIdResponse]:
        """Get an entry by ID

        Get an entry by ID

        :param id: Glossary entry ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entry_by_id_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntryByIdResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_get_entry_by_id_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get an entry by ID

        Get an entry by ID

        :param id: Glossary entry ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_entry_by_id_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetEntryByIdResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_get_entry_by_id_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_get_entry_by_id'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_get_entry_by_id'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_get_entry_by_id',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_get_glossaries_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course IDs")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve a list of glossaries from several courses.

        Retrieve a list of glossaries from several courses.

        :param courseids: Array of course IDs
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_glossaries_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetGlossariesByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_get_glossaries_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course IDs")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryGetGlossariesByCoursesResponse:
        """Retrieve a list of glossaries from several courses.

        Retrieve a list of glossaries from several courses.

        :param courseids: Array of course IDs
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_glossaries_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetGlossariesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_glossaries_by_courses_from_args(
        self,
        args
    ) -> ModGlossaryGetGlossariesByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetGlossariesByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_get_glossaries_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course IDs")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryGetGlossariesByCoursesResponse]:
        """Retrieve a list of glossaries from several courses.

        Retrieve a list of glossaries from several courses.

        :param courseids: Array of course IDs
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_glossaries_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetGlossariesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_get_glossaries_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course IDs")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve a list of glossaries from several courses.

        Retrieve a list of glossaries from several courses.

        :param courseids: Array of course IDs
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_get_glossaries_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryGetGlossariesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_get_glossaries_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_get_glossaries_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_get_glossaries_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_get_glossaries_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_prepare_entry_for_edition_args(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Glossary entry id to update")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Prepares the given entry for edition returning draft item areas and file areas information.

        Prepares the given entry for edition returning draft item areas and file areas information.

        :param entryid: Glossary entry id to update (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_prepare_entry_for_edition_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryPrepareEntryForEditionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_prepare_entry_for_edition(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Glossary entry id to update")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryPrepareEntryForEditionResponse:
        """Prepares the given entry for edition returning draft item areas and file areas information.

        Prepares the given entry for edition returning draft item areas and file areas information.

        :param entryid: Glossary entry id to update (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_prepare_entry_for_edition_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryPrepareEntryForEditionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_prepare_entry_for_edition_from_args(
        self,
        args
    ) -> ModGlossaryPrepareEntryForEditionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryPrepareEntryForEditionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_prepare_entry_for_edition_with_http_info(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Glossary entry id to update")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryPrepareEntryForEditionResponse]:
        """Prepares the given entry for edition returning draft item areas and file areas information.

        Prepares the given entry for edition returning draft item areas and file areas information.

        :param entryid: Glossary entry id to update (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_prepare_entry_for_edition_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryPrepareEntryForEditionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_prepare_entry_for_edition_without_preload_content(
        self,
        entryid: Annotated[Optional[StrictInt], Field(description="Glossary entry id to update")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Prepares the given entry for edition returning draft item areas and file areas information.

        Prepares the given entry for edition returning draft item areas and file areas information.

        :param entryid: Glossary entry id to update (required)
        :type entryid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_prepare_entry_for_edition_serialize(
            entryid=entryid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryPrepareEntryForEditionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_prepare_entry_for_edition_serialize(
        self,
        entryid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_prepare_entry_for_edition'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_prepare_entry_for_edition'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_prepare_entry_for_edition',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if entryid is not None:
            _form_params += parse_form({'entryid': entryid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_update_entry_args(
        self,
        concept: Annotated[Optional[StrictStr], Field(description="Glossary concept")],
        definition: Annotated[Optional[StrictStr], Field(description="Glossary concept definition")],
        definitionformat: Annotated[Optional[StrictInt], Field(description="definition format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")],
        entryid: Annotated[Optional[StrictInt], Field(description="Glossary entry id to update")],
        options: Annotated[Optional[List[ModGlossaryAddEntryParametersOptionsInner]], Field(description="Optional settings")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Updates the given glossary entry.

        Updates the given glossary entry.

        :param concept: Glossary concept (required)
        :type concept: str
        :param definition: Glossary concept definition (required)
        :type definition: str
        :param definitionformat: definition format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN) (required)
        :type definitionformat: int
        :param entryid: Glossary entry id to update (required)
        :type entryid: int
        :param options: Optional settings
        :type options: List[ModGlossaryAddEntryParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_update_entry_serialize(
            concept=concept,
            definition=definition,
            definitionformat=definitionformat,
            entryid=entryid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryUpdateEntryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_update_entry(
        self,
        concept: Annotated[Optional[StrictStr], Field(description="Glossary concept")],
        definition: Annotated[Optional[StrictStr], Field(description="Glossary concept definition")],
        definitionformat: Annotated[Optional[StrictInt], Field(description="definition format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")],
        entryid: Annotated[Optional[StrictInt], Field(description="Glossary entry id to update")],
        options: Annotated[Optional[List[ModGlossaryAddEntryParametersOptionsInner]], Field(description="Optional settings")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryUpdateEntryResponse:
        """Updates the given glossary entry.

        Updates the given glossary entry.

        :param concept: Glossary concept (required)
        :type concept: str
        :param definition: Glossary concept definition (required)
        :type definition: str
        :param definitionformat: definition format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN) (required)
        :type definitionformat: int
        :param entryid: Glossary entry id to update (required)
        :type entryid: int
        :param options: Optional settings
        :type options: List[ModGlossaryAddEntryParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_update_entry_serialize(
            concept=concept,
            definition=definition,
            definitionformat=definitionformat,
            entryid=entryid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryUpdateEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_update_entry_from_args(
        self,
        args
    ) -> ModGlossaryUpdateEntryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryUpdateEntryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_update_entry_with_http_info(
        self,
        concept: Annotated[Optional[StrictStr], Field(description="Glossary concept")],
        definition: Annotated[Optional[StrictStr], Field(description="Glossary concept definition")],
        definitionformat: Annotated[Optional[StrictInt], Field(description="definition format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")],
        entryid: Annotated[Optional[StrictInt], Field(description="Glossary entry id to update")],
        options: Annotated[Optional[List[ModGlossaryAddEntryParametersOptionsInner]], Field(description="Optional settings")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryUpdateEntryResponse]:
        """Updates the given glossary entry.

        Updates the given glossary entry.

        :param concept: Glossary concept (required)
        :type concept: str
        :param definition: Glossary concept definition (required)
        :type definition: str
        :param definitionformat: definition format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN) (required)
        :type definitionformat: int
        :param entryid: Glossary entry id to update (required)
        :type entryid: int
        :param options: Optional settings
        :type options: List[ModGlossaryAddEntryParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_update_entry_serialize(
            concept=concept,
            definition=definition,
            definitionformat=definitionformat,
            entryid=entryid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryUpdateEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_update_entry_without_preload_content(
        self,
        concept: Annotated[Optional[StrictStr], Field(description="Glossary concept")],
        definition: Annotated[Optional[StrictStr], Field(description="Glossary concept definition")],
        definitionformat: Annotated[Optional[StrictInt], Field(description="definition format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN)")],
        entryid: Annotated[Optional[StrictInt], Field(description="Glossary entry id to update")],
        options: Annotated[Optional[List[ModGlossaryAddEntryParametersOptionsInner]], Field(description="Optional settings")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Updates the given glossary entry.

        Updates the given glossary entry.

        :param concept: Glossary concept (required)
        :type concept: str
        :param definition: Glossary concept definition (required)
        :type definition: str
        :param definitionformat: definition format (1 = HTML, 0 = MOODLE, 2 = PLAIN, or 4 = MARKDOWN) (required)
        :type definitionformat: int
        :param entryid: Glossary entry id to update (required)
        :type entryid: int
        :param options: Optional settings
        :type options: List[ModGlossaryAddEntryParametersOptionsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_update_entry_serialize(
            concept=concept,
            definition=definition,
            definitionformat=definitionformat,
            entryid=entryid,
            options=options,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryUpdateEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_update_entry_serialize(
        self,
        concept,
        definition,
        definitionformat,
        entryid,
        options,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'options': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_update_entry'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_update_entry'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_update_entry',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if concept is not None:
            _form_params += parse_form({'concept': concept})
        if definition is not None:
            _form_params += parse_form({'definition': definition})
        if definitionformat is not None:
            _form_params += parse_form({'definitionformat': definitionformat})
        if entryid is not None:
            _form_params += parse_form({'entryid': entryid})
        if options is not None:
            _form_params += parse_form({'options': options})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_view_entry_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Notify a glossary entry as being viewed.

        Notify a glossary entry as being viewed.

        :param id: Glossary entry ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_view_entry_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryViewEntryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_view_entry(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryViewEntryResponse:
        """Notify a glossary entry as being viewed.

        Notify a glossary entry as being viewed.

        :param id: Glossary entry ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_view_entry_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryViewEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_view_entry_from_args(
        self,
        args
    ) -> ModGlossaryViewEntryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryViewEntryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_view_entry_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryViewEntryResponse]:
        """Notify a glossary entry as being viewed.

        Notify a glossary entry as being viewed.

        :param id: Glossary entry ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_view_entry_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryViewEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_view_entry_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary entry ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Notify a glossary entry as being viewed.

        Notify a glossary entry as being viewed.

        :param id: Glossary entry ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_view_entry_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryViewEntryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_view_entry_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_view_entry'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_view_entry'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_view_entry',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_glossary_view_glossary_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary instance ID")],
        mode: Annotated[Optional[StrictStr], Field(description="The mode in which the glossary is viewed")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Notify the glossary as being viewed.

        Notify the glossary as being viewed.

        :param id: Glossary instance ID (required)
        :type id: int
        :param mode: The mode in which the glossary is viewed (required)
        :type mode: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_view_glossary_serialize(
            id=id,
            mode=mode,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryViewGlossaryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_glossary_view_glossary(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary instance ID")],
        mode: Annotated[Optional[StrictStr], Field(description="The mode in which the glossary is viewed")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModGlossaryViewGlossaryResponse:
        """Notify the glossary as being viewed.

        Notify the glossary as being viewed.

        :param id: Glossary instance ID (required)
        :type id: int
        :param mode: The mode in which the glossary is viewed (required)
        :type mode: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_view_glossary_serialize(
            id=id,
            mode=mode,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryViewGlossaryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_view_glossary_from_args(
        self,
        args
    ) -> ModGlossaryViewGlossaryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryViewGlossaryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_glossary_view_glossary_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary instance ID")],
        mode: Annotated[Optional[StrictStr], Field(description="The mode in which the glossary is viewed")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModGlossaryViewGlossaryResponse]:
        """Notify the glossary as being viewed.

        Notify the glossary as being viewed.

        :param id: Glossary instance ID (required)
        :type id: int
        :param mode: The mode in which the glossary is viewed (required)
        :type mode: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_view_glossary_serialize(
            id=id,
            mode=mode,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryViewGlossaryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_glossary_view_glossary_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Glossary instance ID")],
        mode: Annotated[Optional[StrictStr], Field(description="The mode in which the glossary is viewed")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Notify the glossary as being viewed.

        Notify the glossary as being viewed.

        :param id: Glossary instance ID (required)
        :type id: int
        :param mode: The mode in which the glossary is viewed (required)
        :type mode: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_glossary_view_glossary_serialize(
            id=id,
            mode=mode,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModGlossaryViewGlossaryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_glossary_view_glossary_serialize(
        self,
        id,
        mode,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_glossary_view_glossary'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_glossary_view_glossary'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_glossary_view_glossary',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        if mode is not None:
            _form_params += parse_form({'mode': mode})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_h5pactivity_get_attempts_args(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        userids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="User ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the information needed to list a user attempts.

        Return the information needed to list a user attempts.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param userids: User ids
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_attempts_serialize(
            h5pactivityid=h5pactivityid,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetAttemptsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_h5pactivity_get_attempts(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        userids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="User ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModH5pactivityGetAttemptsResponse:
        """Return the information needed to list a user attempts.

        Return the information needed to list a user attempts.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param userids: User ids
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_attempts_serialize(
            h5pactivityid=h5pactivityid,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetAttemptsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_h5pactivity_get_attempts_from_args(
        self,
        args
    ) -> ModH5pactivityGetAttemptsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetAttemptsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_h5pactivity_get_attempts_with_http_info(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        userids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="User ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModH5pactivityGetAttemptsResponse]:
        """Return the information needed to list a user attempts.

        Return the information needed to list a user attempts.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param userids: User ids
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_attempts_serialize(
            h5pactivityid=h5pactivityid,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetAttemptsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_h5pactivity_get_attempts_without_preload_content(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        userids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="User ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the information needed to list a user attempts.

        Return the information needed to list a user attempts.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param userids: User ids
        :type userids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_attempts_serialize(
            h5pactivityid=h5pactivityid,
            userids=userids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetAttemptsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_h5pactivity_get_attempts_serialize(
        self,
        h5pactivityid,
        userids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'userids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_h5pactivity_get_attempts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_h5pactivity_get_attempts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_h5pactivity_get_attempts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if h5pactivityid is not None:
            _form_params += parse_form({'h5pactivityid': h5pactivityid})
        if userids is not None:
            _form_params += parse_form({'userids': userids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_h5pactivity_get_h5pactivities_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of h5p activities in a list of             provided courses, if no list is provided all h5p activities             that the user can view will be returned.

        Returns a list of h5p activities in a list of             provided courses, if no list is provided all h5p activities             that the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_h5pactivities_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetH5pactivitiesByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_h5pactivity_get_h5pactivities_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModH5pactivityGetH5pactivitiesByCoursesResponse:
        """Returns a list of h5p activities in a list of             provided courses, if no list is provided all h5p activities             that the user can view will be returned.

        Returns a list of h5p activities in a list of             provided courses, if no list is provided all h5p activities             that the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_h5pactivities_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetH5pactivitiesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_h5pactivity_get_h5pactivities_by_courses_from_args(
        self,
        args
    ) -> ModH5pactivityGetH5pactivitiesByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetH5pactivitiesByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_h5pactivity_get_h5pactivities_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModH5pactivityGetH5pactivitiesByCoursesResponse]:
        """Returns a list of h5p activities in a list of             provided courses, if no list is provided all h5p activities             that the user can view will be returned.

        Returns a list of h5p activities in a list of             provided courses, if no list is provided all h5p activities             that the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_h5pactivities_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetH5pactivitiesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_h5pactivity_get_h5pactivities_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of h5p activities in a list of             provided courses, if no list is provided all h5p activities             that the user can view will be returned.

        Returns a list of h5p activities in a list of             provided courses, if no list is provided all h5p activities             that the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_h5pactivities_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetH5pactivitiesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_h5pactivity_get_h5pactivities_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_h5pactivity_get_h5pactivities_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_h5pactivity_get_h5pactivities_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_h5pactivity_get_h5pactivities_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_h5pactivity_get_h5pactivity_access_information_args(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return access information for a given h5p activity.

        Return access information for a given h5p activity.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_h5pactivity_access_information_serialize(
            h5pactivityid=h5pactivityid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetH5pactivityAccessInformationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_h5pactivity_get_h5pactivity_access_information(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModH5pactivityGetH5pactivityAccessInformationResponse:
        """Return access information for a given h5p activity.

        Return access information for a given h5p activity.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_h5pactivity_access_information_serialize(
            h5pactivityid=h5pactivityid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetH5pactivityAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_h5pactivity_get_h5pactivity_access_information_from_args(
        self,
        args
    ) -> ModH5pactivityGetH5pactivityAccessInformationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetH5pactivityAccessInformationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_h5pactivity_get_h5pactivity_access_information_with_http_info(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModH5pactivityGetH5pactivityAccessInformationResponse]:
        """Return access information for a given h5p activity.

        Return access information for a given h5p activity.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_h5pactivity_access_information_serialize(
            h5pactivityid=h5pactivityid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetH5pactivityAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_h5pactivity_get_h5pactivity_access_information_without_preload_content(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return access information for a given h5p activity.

        Return access information for a given h5p activity.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_h5pactivity_access_information_serialize(
            h5pactivityid=h5pactivityid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetH5pactivityAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_h5pactivity_get_h5pactivity_access_information_serialize(
        self,
        h5pactivityid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_h5pactivity_get_h5pactivity_access_information'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_h5pactivity_get_h5pactivity_access_information'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_h5pactivity_get_h5pactivity_access_information',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if h5pactivityid is not None:
            _form_params += parse_form({'h5pactivityid': h5pactivityid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_h5pactivity_get_results_args(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        attemptids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Attempt ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the information needed to list a user attempt results.

        Return the information needed to list a user attempt results.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param attemptids: Attempt ids
        :type attemptids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_results_serialize(
            h5pactivityid=h5pactivityid,
            attemptids=attemptids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetResultsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_h5pactivity_get_results(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        attemptids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Attempt ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModH5pactivityGetResultsResponse:
        """Return the information needed to list a user attempt results.

        Return the information needed to list a user attempt results.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param attemptids: Attempt ids
        :type attemptids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_results_serialize(
            h5pactivityid=h5pactivityid,
            attemptids=attemptids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetResultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_h5pactivity_get_results_from_args(
        self,
        args
    ) -> ModH5pactivityGetResultsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetResultsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_h5pactivity_get_results_with_http_info(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        attemptids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Attempt ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModH5pactivityGetResultsResponse]:
        """Return the information needed to list a user attempt results.

        Return the information needed to list a user attempt results.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param attemptids: Attempt ids
        :type attemptids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_results_serialize(
            h5pactivityid=h5pactivityid,
            attemptids=attemptids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetResultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_h5pactivity_get_results_without_preload_content(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        attemptids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Attempt ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the information needed to list a user attempt results.

        Return the information needed to list a user attempt results.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param attemptids: Attempt ids
        :type attemptids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_results_serialize(
            h5pactivityid=h5pactivityid,
            attemptids=attemptids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetResultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_h5pactivity_get_results_serialize(
        self,
        h5pactivityid,
        attemptids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'attemptids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_h5pactivity_get_results'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_h5pactivity_get_results'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_h5pactivity_get_results',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attemptids is not None:
            _form_params += parse_form({'attemptids': attemptids})
        if h5pactivityid is not None:
            _form_params += parse_form({'h5pactivityid': h5pactivityid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_h5pactivity_get_user_attempts_args(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        firstinitial: Annotated[Optional[StrictStr], Field(description="Users whose first name starts with $firstinitial")] = None,
        lastinitial: Annotated[Optional[StrictStr], Field(description="Users whose last name starts with $lastinitial")] = None,
        page: Annotated[Optional[StrictInt], Field(description="current page")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="items per page")] = None,
        sortorder: Annotated[Optional[StrictStr], Field(description="sort by either user id, firstname or lastname (with optional asc/desc)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the information needed to list all enrolled user attempts.

        Return the information needed to list all enrolled user attempts.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param firstinitial: Users whose first name starts with $firstinitial
        :type firstinitial: str
        :param lastinitial: Users whose last name starts with $lastinitial
        :type lastinitial: str
        :param page: current page
        :type page: int
        :param perpage: items per page
        :type perpage: int
        :param sortorder: sort by either user id, firstname or lastname (with optional asc/desc)
        :type sortorder: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_user_attempts_serialize(
            h5pactivityid=h5pactivityid,
            firstinitial=firstinitial,
            lastinitial=lastinitial,
            page=page,
            perpage=perpage,
            sortorder=sortorder,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetUserAttemptsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_h5pactivity_get_user_attempts(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        firstinitial: Annotated[Optional[StrictStr], Field(description="Users whose first name starts with $firstinitial")] = None,
        lastinitial: Annotated[Optional[StrictStr], Field(description="Users whose last name starts with $lastinitial")] = None,
        page: Annotated[Optional[StrictInt], Field(description="current page")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="items per page")] = None,
        sortorder: Annotated[Optional[StrictStr], Field(description="sort by either user id, firstname or lastname (with optional asc/desc)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModH5pactivityGetUserAttemptsResponse:
        """Return the information needed to list all enrolled user attempts.

        Return the information needed to list all enrolled user attempts.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param firstinitial: Users whose first name starts with $firstinitial
        :type firstinitial: str
        :param lastinitial: Users whose last name starts with $lastinitial
        :type lastinitial: str
        :param page: current page
        :type page: int
        :param perpage: items per page
        :type perpage: int
        :param sortorder: sort by either user id, firstname or lastname (with optional asc/desc)
        :type sortorder: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_user_attempts_serialize(
            h5pactivityid=h5pactivityid,
            firstinitial=firstinitial,
            lastinitial=lastinitial,
            page=page,
            perpage=perpage,
            sortorder=sortorder,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetUserAttemptsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_h5pactivity_get_user_attempts_from_args(
        self,
        args
    ) -> ModH5pactivityGetUserAttemptsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetUserAttemptsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_h5pactivity_get_user_attempts_with_http_info(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        firstinitial: Annotated[Optional[StrictStr], Field(description="Users whose first name starts with $firstinitial")] = None,
        lastinitial: Annotated[Optional[StrictStr], Field(description="Users whose last name starts with $lastinitial")] = None,
        page: Annotated[Optional[StrictInt], Field(description="current page")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="items per page")] = None,
        sortorder: Annotated[Optional[StrictStr], Field(description="sort by either user id, firstname or lastname (with optional asc/desc)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModH5pactivityGetUserAttemptsResponse]:
        """Return the information needed to list all enrolled user attempts.

        Return the information needed to list all enrolled user attempts.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param firstinitial: Users whose first name starts with $firstinitial
        :type firstinitial: str
        :param lastinitial: Users whose last name starts with $lastinitial
        :type lastinitial: str
        :param page: current page
        :type page: int
        :param perpage: items per page
        :type perpage: int
        :param sortorder: sort by either user id, firstname or lastname (with optional asc/desc)
        :type sortorder: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_user_attempts_serialize(
            h5pactivityid=h5pactivityid,
            firstinitial=firstinitial,
            lastinitial=lastinitial,
            page=page,
            perpage=perpage,
            sortorder=sortorder,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetUserAttemptsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_h5pactivity_get_user_attempts_without_preload_content(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        firstinitial: Annotated[Optional[StrictStr], Field(description="Users whose first name starts with $firstinitial")] = None,
        lastinitial: Annotated[Optional[StrictStr], Field(description="Users whose last name starts with $lastinitial")] = None,
        page: Annotated[Optional[StrictInt], Field(description="current page")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="items per page")] = None,
        sortorder: Annotated[Optional[StrictStr], Field(description="sort by either user id, firstname or lastname (with optional asc/desc)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the information needed to list all enrolled user attempts.

        Return the information needed to list all enrolled user attempts.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param firstinitial: Users whose first name starts with $firstinitial
        :type firstinitial: str
        :param lastinitial: Users whose last name starts with $lastinitial
        :type lastinitial: str
        :param page: current page
        :type page: int
        :param perpage: items per page
        :type perpage: int
        :param sortorder: sort by either user id, firstname or lastname (with optional asc/desc)
        :type sortorder: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_get_user_attempts_serialize(
            h5pactivityid=h5pactivityid,
            firstinitial=firstinitial,
            lastinitial=lastinitial,
            page=page,
            perpage=perpage,
            sortorder=sortorder,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityGetUserAttemptsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_h5pactivity_get_user_attempts_serialize(
        self,
        h5pactivityid,
        firstinitial,
        lastinitial,
        page,
        perpage,
        sortorder,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_h5pactivity_get_user_attempts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_h5pactivity_get_user_attempts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_h5pactivity_get_user_attempts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if firstinitial is not None:
            _form_params += parse_form({'firstinitial': firstinitial})
        if h5pactivityid is not None:
            _form_params += parse_form({'h5pactivityid': h5pactivityid})
        if lastinitial is not None:
            _form_params += parse_form({'lastinitial': lastinitial})
        if page is not None:
            _form_params += parse_form({'page': page})
        if perpage is not None:
            _form_params += parse_form({'perpage': perpage})
        if sortorder is not None:
            _form_params += parse_form({'sortorder': sortorder})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_h5pactivity_log_report_viewed_args(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        attemptid: Annotated[Optional[StrictInt], Field(description="The attempt id")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="The user id to log attempt (null means only current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Log that the h5pactivity was viewed.

        Log that the h5pactivity was viewed.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param attemptid: The attempt id
        :type attemptid: int
        :param userid: The user id to log attempt (null means only current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_log_report_viewed_serialize(
            h5pactivityid=h5pactivityid,
            attemptid=attemptid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityLogReportViewedResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_h5pactivity_log_report_viewed(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        attemptid: Annotated[Optional[StrictInt], Field(description="The attempt id")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="The user id to log attempt (null means only current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModH5pactivityLogReportViewedResponse:
        """Log that the h5pactivity was viewed.

        Log that the h5pactivity was viewed.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param attemptid: The attempt id
        :type attemptid: int
        :param userid: The user id to log attempt (null means only current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_log_report_viewed_serialize(
            h5pactivityid=h5pactivityid,
            attemptid=attemptid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityLogReportViewedResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_h5pactivity_log_report_viewed_from_args(
        self,
        args
    ) -> ModH5pactivityLogReportViewedResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityLogReportViewedResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_h5pactivity_log_report_viewed_with_http_info(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        attemptid: Annotated[Optional[StrictInt], Field(description="The attempt id")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="The user id to log attempt (null means only current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModH5pactivityLogReportViewedResponse]:
        """Log that the h5pactivity was viewed.

        Log that the h5pactivity was viewed.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param attemptid: The attempt id
        :type attemptid: int
        :param userid: The user id to log attempt (null means only current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_log_report_viewed_serialize(
            h5pactivityid=h5pactivityid,
            attemptid=attemptid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityLogReportViewedResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_h5pactivity_log_report_viewed_without_preload_content(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="h5p activity instance id")],
        attemptid: Annotated[Optional[StrictInt], Field(description="The attempt id")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="The user id to log attempt (null means only current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Log that the h5pactivity was viewed.

        Log that the h5pactivity was viewed.

        :param h5pactivityid: h5p activity instance id (required)
        :type h5pactivityid: int
        :param attemptid: The attempt id
        :type attemptid: int
        :param userid: The user id to log attempt (null means only current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_log_report_viewed_serialize(
            h5pactivityid=h5pactivityid,
            attemptid=attemptid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityLogReportViewedResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_h5pactivity_log_report_viewed_serialize(
        self,
        h5pactivityid,
        attemptid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_h5pactivity_log_report_viewed'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_h5pactivity_log_report_viewed'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_h5pactivity_log_report_viewed',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attemptid is not None:
            _form_params += parse_form({'attemptid': attemptid})
        if h5pactivityid is not None:
            _form_params += parse_form({'h5pactivityid': h5pactivityid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_h5pactivity_view_h5pactivity_args(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="H5P activity instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param h5pactivityid: H5P activity instance id (required)
        :type h5pactivityid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_view_h5pactivity_serialize(
            h5pactivityid=h5pactivityid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityViewH5pactivityResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_h5pactivity_view_h5pactivity(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="H5P activity instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModH5pactivityViewH5pactivityResponse:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param h5pactivityid: H5P activity instance id (required)
        :type h5pactivityid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_view_h5pactivity_serialize(
            h5pactivityid=h5pactivityid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityViewH5pactivityResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_h5pactivity_view_h5pactivity_from_args(
        self,
        args
    ) -> ModH5pactivityViewH5pactivityResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityViewH5pactivityResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_h5pactivity_view_h5pactivity_with_http_info(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="H5P activity instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModH5pactivityViewH5pactivityResponse]:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param h5pactivityid: H5P activity instance id (required)
        :type h5pactivityid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_view_h5pactivity_serialize(
            h5pactivityid=h5pactivityid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityViewH5pactivityResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_h5pactivity_view_h5pactivity_without_preload_content(
        self,
        h5pactivityid: Annotated[Optional[StrictInt], Field(description="H5P activity instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param h5pactivityid: H5P activity instance id (required)
        :type h5pactivityid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_h5pactivity_view_h5pactivity_serialize(
            h5pactivityid=h5pactivityid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModH5pactivityViewH5pactivityResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_h5pactivity_view_h5pactivity_serialize(
        self,
        h5pactivityid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_h5pactivity_view_h5pactivity'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_h5pactivity_view_h5pactivity'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_h5pactivity_view_h5pactivity',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if h5pactivityid is not None:
            _form_params += parse_form({'h5pactivityid': h5pactivityid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_imscp_get_imscps_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of IMSCP instances in a provided set of courses,                             if no courses are provided then all the IMSCP instances the user has access to will be returned.

        Returns a list of IMSCP instances in a provided set of courses,                             if no courses are provided then all the IMSCP instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_imscp_get_imscps_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModImscpGetImscpsByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_imscp_get_imscps_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModImscpGetImscpsByCoursesResponse:
        """Returns a list of IMSCP instances in a provided set of courses,                             if no courses are provided then all the IMSCP instances the user has access to will be returned.

        Returns a list of IMSCP instances in a provided set of courses,                             if no courses are provided then all the IMSCP instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_imscp_get_imscps_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModImscpGetImscpsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_imscp_get_imscps_by_courses_from_args(
        self,
        args
    ) -> ModImscpGetImscpsByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModImscpGetImscpsByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_imscp_get_imscps_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModImscpGetImscpsByCoursesResponse]:
        """Returns a list of IMSCP instances in a provided set of courses,                             if no courses are provided then all the IMSCP instances the user has access to will be returned.

        Returns a list of IMSCP instances in a provided set of courses,                             if no courses are provided then all the IMSCP instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_imscp_get_imscps_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModImscpGetImscpsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_imscp_get_imscps_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of IMSCP instances in a provided set of courses,                             if no courses are provided then all the IMSCP instances the user has access to will be returned.

        Returns a list of IMSCP instances in a provided set of courses,                             if no courses are provided then all the IMSCP instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_imscp_get_imscps_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModImscpGetImscpsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_imscp_get_imscps_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_imscp_get_imscps_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_imscp_get_imscps_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_imscp_get_imscps_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_imscp_view_imscp_args(
        self,
        imscpid: Annotated[Optional[StrictInt], Field(description="imscp instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Simulate the view.php web interface imscp: trigger events, completion, etc...

        Simulate the view.php web interface imscp: trigger events, completion, etc...

        :param imscpid: imscp instance id (required)
        :type imscpid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_imscp_view_imscp_serialize(
            imscpid=imscpid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModImscpViewImscpResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_imscp_view_imscp(
        self,
        imscpid: Annotated[Optional[StrictInt], Field(description="imscp instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModImscpViewImscpResponse:
        """Simulate the view.php web interface imscp: trigger events, completion, etc...

        Simulate the view.php web interface imscp: trigger events, completion, etc...

        :param imscpid: imscp instance id (required)
        :type imscpid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_imscp_view_imscp_serialize(
            imscpid=imscpid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModImscpViewImscpResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_imscp_view_imscp_from_args(
        self,
        args
    ) -> ModImscpViewImscpResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModImscpViewImscpResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_imscp_view_imscp_with_http_info(
        self,
        imscpid: Annotated[Optional[StrictInt], Field(description="imscp instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModImscpViewImscpResponse]:
        """Simulate the view.php web interface imscp: trigger events, completion, etc...

        Simulate the view.php web interface imscp: trigger events, completion, etc...

        :param imscpid: imscp instance id (required)
        :type imscpid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_imscp_view_imscp_serialize(
            imscpid=imscpid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModImscpViewImscpResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_imscp_view_imscp_without_preload_content(
        self,
        imscpid: Annotated[Optional[StrictInt], Field(description="imscp instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Simulate the view.php web interface imscp: trigger events, completion, etc...

        Simulate the view.php web interface imscp: trigger events, completion, etc...

        :param imscpid: imscp instance id (required)
        :type imscpid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_imscp_view_imscp_serialize(
            imscpid=imscpid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModImscpViewImscpResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_imscp_view_imscp_serialize(
        self,
        imscpid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_imscp_view_imscp'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_imscp_view_imscp'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_imscp_view_imscp',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if imscpid is not None:
            _form_params += parse_form({'imscpid': imscpid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_label_get_labels_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of labels in a provided list of courses, if no list is provided all labels that the user                             can view will be returned.

        Returns a list of labels in a provided list of courses, if no list is provided all labels that the user                             can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_label_get_labels_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLabelGetLabelsByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_label_get_labels_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLabelGetLabelsByCoursesResponse:
        """Returns a list of labels in a provided list of courses, if no list is provided all labels that the user                             can view will be returned.

        Returns a list of labels in a provided list of courses, if no list is provided all labels that the user                             can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_label_get_labels_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLabelGetLabelsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_label_get_labels_by_courses_from_args(
        self,
        args
    ) -> ModLabelGetLabelsByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLabelGetLabelsByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_label_get_labels_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLabelGetLabelsByCoursesResponse]:
        """Returns a list of labels in a provided list of courses, if no list is provided all labels that the user                             can view will be returned.

        Returns a list of labels in a provided list of courses, if no list is provided all labels that the user                             can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_label_get_labels_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLabelGetLabelsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_label_get_labels_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of labels in a provided list of courses, if no list is provided all labels that the user                             can view will be returned.

        Returns a list of labels in a provided list of courses, if no list is provided all labels that the user                             can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_label_get_labels_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLabelGetLabelsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_label_get_labels_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_label_get_labels_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_label_get_labels_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_label_get_labels_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_finish_attempt_args(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="Lesson instance id.")],
        outoftime: Annotated[Optional[StrictBool], Field(description="If the user run out of time.")] = None,
        password: Annotated[Optional[StrictStr], Field(description="Optional password (the lesson may be protected).")] = None,
        review: Annotated[Optional[StrictBool], Field(description="If we want to review just after finishing (1 hour margin).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Finishes the current attempt.

        Finishes the current attempt.

        :param lessonid: Lesson instance id. (required)
        :type lessonid: int
        :param outoftime: If the user run out of time.
        :type outoftime: bool
        :param password: Optional password (the lesson may be protected).
        :type password: str
        :param review: If we want to review just after finishing (1 hour margin).
        :type review: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_finish_attempt_serialize(
            lessonid=lessonid,
            outoftime=outoftime,
            password=password,
            review=review,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonFinishAttemptResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_finish_attempt(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="Lesson instance id.")],
        outoftime: Annotated[Optional[StrictBool], Field(description="If the user run out of time.")] = None,
        password: Annotated[Optional[StrictStr], Field(description="Optional password (the lesson may be protected).")] = None,
        review: Annotated[Optional[StrictBool], Field(description="If we want to review just after finishing (1 hour margin).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonFinishAttemptResponse:
        """Finishes the current attempt.

        Finishes the current attempt.

        :param lessonid: Lesson instance id. (required)
        :type lessonid: int
        :param outoftime: If the user run out of time.
        :type outoftime: bool
        :param password: Optional password (the lesson may be protected).
        :type password: str
        :param review: If we want to review just after finishing (1 hour margin).
        :type review: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_finish_attempt_serialize(
            lessonid=lessonid,
            outoftime=outoftime,
            password=password,
            review=review,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonFinishAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_finish_attempt_from_args(
        self,
        args
    ) -> ModLessonFinishAttemptResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonFinishAttemptResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_finish_attempt_with_http_info(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="Lesson instance id.")],
        outoftime: Annotated[Optional[StrictBool], Field(description="If the user run out of time.")] = None,
        password: Annotated[Optional[StrictStr], Field(description="Optional password (the lesson may be protected).")] = None,
        review: Annotated[Optional[StrictBool], Field(description="If we want to review just after finishing (1 hour margin).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonFinishAttemptResponse]:
        """Finishes the current attempt.

        Finishes the current attempt.

        :param lessonid: Lesson instance id. (required)
        :type lessonid: int
        :param outoftime: If the user run out of time.
        :type outoftime: bool
        :param password: Optional password (the lesson may be protected).
        :type password: str
        :param review: If we want to review just after finishing (1 hour margin).
        :type review: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_finish_attempt_serialize(
            lessonid=lessonid,
            outoftime=outoftime,
            password=password,
            review=review,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonFinishAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_finish_attempt_without_preload_content(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="Lesson instance id.")],
        outoftime: Annotated[Optional[StrictBool], Field(description="If the user run out of time.")] = None,
        password: Annotated[Optional[StrictStr], Field(description="Optional password (the lesson may be protected).")] = None,
        review: Annotated[Optional[StrictBool], Field(description="If we want to review just after finishing (1 hour margin).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Finishes the current attempt.

        Finishes the current attempt.

        :param lessonid: Lesson instance id. (required)
        :type lessonid: int
        :param outoftime: If the user run out of time.
        :type outoftime: bool
        :param password: Optional password (the lesson may be protected).
        :type password: str
        :param review: If we want to review just after finishing (1 hour margin).
        :type review: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_finish_attempt_serialize(
            lessonid=lessonid,
            outoftime=outoftime,
            password=password,
            review=review,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonFinishAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_finish_attempt_serialize(
        self,
        lessonid,
        outoftime,
        password,
        review,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_finish_attempt'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_finish_attempt'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_finish_attempt',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if lessonid is not None:
            _form_params += parse_form({'lessonid': lessonid})
        if outoftime is not None:
            _form_params += parse_form({'outoftime': outoftime})
        if password is not None:
            _form_params += parse_form({'password': password})
        if review is not None:
            _form_params += parse_form({'review': review})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_get_attempts_overview_args(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="group id, 0 means that the function will determine the user group")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get a list of all the attempts made by users in a lesson.

        Get a list of all the attempts made by users in a lesson.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param groupid: group id, 0 means that the function will determine the user group
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_attempts_overview_serialize(
            lessonid=lessonid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetAttemptsOverviewResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_get_attempts_overview(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="group id, 0 means that the function will determine the user group")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonGetAttemptsOverviewResponse:
        """Get a list of all the attempts made by users in a lesson.

        Get a list of all the attempts made by users in a lesson.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param groupid: group id, 0 means that the function will determine the user group
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_attempts_overview_serialize(
            lessonid=lessonid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetAttemptsOverviewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_attempts_overview_from_args(
        self,
        args
    ) -> ModLessonGetAttemptsOverviewResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetAttemptsOverviewResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_attempts_overview_with_http_info(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="group id, 0 means that the function will determine the user group")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonGetAttemptsOverviewResponse]:
        """Get a list of all the attempts made by users in a lesson.

        Get a list of all the attempts made by users in a lesson.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param groupid: group id, 0 means that the function will determine the user group
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_attempts_overview_serialize(
            lessonid=lessonid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetAttemptsOverviewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_get_attempts_overview_without_preload_content(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        groupid: Annotated[Optional[StrictInt], Field(description="group id, 0 means that the function will determine the user group")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get a list of all the attempts made by users in a lesson.

        Get a list of all the attempts made by users in a lesson.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param groupid: group id, 0 means that the function will determine the user group
        :type groupid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_attempts_overview_serialize(
            lessonid=lessonid,
            groupid=groupid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetAttemptsOverviewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_get_attempts_overview_serialize(
        self,
        lessonid,
        groupid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_get_attempts_overview'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_get_attempts_overview'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_get_attempts_overview',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if lessonid is not None:
            _form_params += parse_form({'lessonid': lessonid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_get_content_pages_viewed_args(
        self,
        lessonattempt: Annotated[Optional[StrictInt], Field(description="lesson attempt number")],
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="the user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the list of content pages viewed by a user during a lesson attempt.

        Return the list of content pages viewed by a user during a lesson attempt.

        :param lessonattempt: lesson attempt number (required)
        :type lessonattempt: int
        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param userid: the user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_content_pages_viewed_serialize(
            lessonattempt=lessonattempt,
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetContentPagesViewedResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_get_content_pages_viewed(
        self,
        lessonattempt: Annotated[Optional[StrictInt], Field(description="lesson attempt number")],
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="the user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonGetContentPagesViewedResponse:
        """Return the list of content pages viewed by a user during a lesson attempt.

        Return the list of content pages viewed by a user during a lesson attempt.

        :param lessonattempt: lesson attempt number (required)
        :type lessonattempt: int
        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param userid: the user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_content_pages_viewed_serialize(
            lessonattempt=lessonattempt,
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetContentPagesViewedResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_content_pages_viewed_from_args(
        self,
        args
    ) -> ModLessonGetContentPagesViewedResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetContentPagesViewedResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_content_pages_viewed_with_http_info(
        self,
        lessonattempt: Annotated[Optional[StrictInt], Field(description="lesson attempt number")],
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="the user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonGetContentPagesViewedResponse]:
        """Return the list of content pages viewed by a user during a lesson attempt.

        Return the list of content pages viewed by a user during a lesson attempt.

        :param lessonattempt: lesson attempt number (required)
        :type lessonattempt: int
        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param userid: the user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_content_pages_viewed_serialize(
            lessonattempt=lessonattempt,
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetContentPagesViewedResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_get_content_pages_viewed_without_preload_content(
        self,
        lessonattempt: Annotated[Optional[StrictInt], Field(description="lesson attempt number")],
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="the user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the list of content pages viewed by a user during a lesson attempt.

        Return the list of content pages viewed by a user during a lesson attempt.

        :param lessonattempt: lesson attempt number (required)
        :type lessonattempt: int
        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param userid: the user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_content_pages_viewed_serialize(
            lessonattempt=lessonattempt,
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetContentPagesViewedResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_get_content_pages_viewed_serialize(
        self,
        lessonattempt,
        lessonid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_get_content_pages_viewed'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_get_content_pages_viewed'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_get_content_pages_viewed',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if lessonattempt is not None:
            _form_params += parse_form({'lessonattempt': lessonattempt})
        if lessonid is not None:
            _form_params += parse_form({'lessonid': lessonid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_get_lesson_args(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        password: Annotated[Optional[StrictStr], Field(description="lesson password")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return information of a given lesson.

        Return information of a given lesson.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param password: lesson password
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_lesson_serialize(
            lessonid=lessonid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetLessonResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_get_lesson(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        password: Annotated[Optional[StrictStr], Field(description="lesson password")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonGetLessonResponse:
        """Return information of a given lesson.

        Return information of a given lesson.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param password: lesson password
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_lesson_serialize(
            lessonid=lessonid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetLessonResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_lesson_from_args(
        self,
        args
    ) -> ModLessonGetLessonResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetLessonResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_lesson_with_http_info(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        password: Annotated[Optional[StrictStr], Field(description="lesson password")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonGetLessonResponse]:
        """Return information of a given lesson.

        Return information of a given lesson.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param password: lesson password
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_lesson_serialize(
            lessonid=lessonid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetLessonResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_get_lesson_without_preload_content(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        password: Annotated[Optional[StrictStr], Field(description="lesson password")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return information of a given lesson.

        Return information of a given lesson.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param password: lesson password
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_lesson_serialize(
            lessonid=lessonid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetLessonResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_get_lesson_serialize(
        self,
        lessonid,
        password,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_get_lesson'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_get_lesson'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_get_lesson',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if lessonid is not None:
            _form_params += parse_form({'lessonid': lessonid})
        if password is not None:
            _form_params += parse_form({'password': password})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_get_lesson_access_information_args(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return access information for a given lesson.

        Return access information for a given lesson.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_lesson_access_information_serialize(
            lessonid=lessonid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetLessonAccessInformationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_get_lesson_access_information(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonGetLessonAccessInformationResponse:
        """Return access information for a given lesson.

        Return access information for a given lesson.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_lesson_access_information_serialize(
            lessonid=lessonid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetLessonAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_lesson_access_information_from_args(
        self,
        args
    ) -> ModLessonGetLessonAccessInformationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetLessonAccessInformationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_lesson_access_information_with_http_info(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonGetLessonAccessInformationResponse]:
        """Return access information for a given lesson.

        Return access information for a given lesson.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_lesson_access_information_serialize(
            lessonid=lessonid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetLessonAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_get_lesson_access_information_without_preload_content(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return access information for a given lesson.

        Return access information for a given lesson.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_lesson_access_information_serialize(
            lessonid=lessonid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetLessonAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_get_lesson_access_information_serialize(
        self,
        lessonid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_get_lesson_access_information'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_get_lesson_access_information'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_get_lesson_access_information',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if lessonid is not None:
            _form_params += parse_form({'lessonid': lessonid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_get_lessons_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of lessons in a provided list of courses,                             if no list is provided all lessons that the user can view will be returned.

        Returns a list of lessons in a provided list of courses,                             if no list is provided all lessons that the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_lessons_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetLessonsByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_get_lessons_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonGetLessonsByCoursesResponse:
        """Returns a list of lessons in a provided list of courses,                             if no list is provided all lessons that the user can view will be returned.

        Returns a list of lessons in a provided list of courses,                             if no list is provided all lessons that the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_lessons_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetLessonsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_lessons_by_courses_from_args(
        self,
        args
    ) -> ModLessonGetLessonsByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetLessonsByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_lessons_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonGetLessonsByCoursesResponse]:
        """Returns a list of lessons in a provided list of courses,                             if no list is provided all lessons that the user can view will be returned.

        Returns a list of lessons in a provided list of courses,                             if no list is provided all lessons that the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_lessons_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetLessonsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_get_lessons_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of lessons in a provided list of courses,                             if no list is provided all lessons that the user can view will be returned.

        Returns a list of lessons in a provided list of courses,                             if no list is provided all lessons that the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_lessons_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetLessonsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_get_lessons_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_get_lessons_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_get_lessons_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_get_lessons_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_get_page_data_args(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        pageid: Annotated[Optional[StrictInt], Field(description="the page id")],
        password: Annotated[Optional[StrictStr], Field(description="optional password (the lesson may be protected)")] = None,
        returncontents: Annotated[Optional[StrictBool], Field(description="if we must return the complete page contents once rendered")] = None,
        review: Annotated[Optional[StrictBool], Field(description="if we want to review just after finishing (1 hour margin)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return information of a given page, including its contents.

        Return information of a given page, including its contents.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param pageid: the page id (required)
        :type pageid: int
        :param password: optional password (the lesson may be protected)
        :type password: str
        :param returncontents: if we must return the complete page contents once rendered
        :type returncontents: bool
        :param review: if we want to review just after finishing (1 hour margin)
        :type review: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_page_data_serialize(
            lessonid=lessonid,
            pageid=pageid,
            password=password,
            returncontents=returncontents,
            review=review,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetPageDataResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_get_page_data(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        pageid: Annotated[Optional[StrictInt], Field(description="the page id")],
        password: Annotated[Optional[StrictStr], Field(description="optional password (the lesson may be protected)")] = None,
        returncontents: Annotated[Optional[StrictBool], Field(description="if we must return the complete page contents once rendered")] = None,
        review: Annotated[Optional[StrictBool], Field(description="if we want to review just after finishing (1 hour margin)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonGetPageDataResponse:
        """Return information of a given page, including its contents.

        Return information of a given page, including its contents.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param pageid: the page id (required)
        :type pageid: int
        :param password: optional password (the lesson may be protected)
        :type password: str
        :param returncontents: if we must return the complete page contents once rendered
        :type returncontents: bool
        :param review: if we want to review just after finishing (1 hour margin)
        :type review: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_page_data_serialize(
            lessonid=lessonid,
            pageid=pageid,
            password=password,
            returncontents=returncontents,
            review=review,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetPageDataResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_page_data_from_args(
        self,
        args
    ) -> ModLessonGetPageDataResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetPageDataResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_page_data_with_http_info(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        pageid: Annotated[Optional[StrictInt], Field(description="the page id")],
        password: Annotated[Optional[StrictStr], Field(description="optional password (the lesson may be protected)")] = None,
        returncontents: Annotated[Optional[StrictBool], Field(description="if we must return the complete page contents once rendered")] = None,
        review: Annotated[Optional[StrictBool], Field(description="if we want to review just after finishing (1 hour margin)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonGetPageDataResponse]:
        """Return information of a given page, including its contents.

        Return information of a given page, including its contents.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param pageid: the page id (required)
        :type pageid: int
        :param password: optional password (the lesson may be protected)
        :type password: str
        :param returncontents: if we must return the complete page contents once rendered
        :type returncontents: bool
        :param review: if we want to review just after finishing (1 hour margin)
        :type review: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_page_data_serialize(
            lessonid=lessonid,
            pageid=pageid,
            password=password,
            returncontents=returncontents,
            review=review,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetPageDataResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_get_page_data_without_preload_content(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        pageid: Annotated[Optional[StrictInt], Field(description="the page id")],
        password: Annotated[Optional[StrictStr], Field(description="optional password (the lesson may be protected)")] = None,
        returncontents: Annotated[Optional[StrictBool], Field(description="if we must return the complete page contents once rendered")] = None,
        review: Annotated[Optional[StrictBool], Field(description="if we want to review just after finishing (1 hour margin)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return information of a given page, including its contents.

        Return information of a given page, including its contents.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param pageid: the page id (required)
        :type pageid: int
        :param password: optional password (the lesson may be protected)
        :type password: str
        :param returncontents: if we must return the complete page contents once rendered
        :type returncontents: bool
        :param review: if we want to review just after finishing (1 hour margin)
        :type review: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_page_data_serialize(
            lessonid=lessonid,
            pageid=pageid,
            password=password,
            returncontents=returncontents,
            review=review,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetPageDataResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_get_page_data_serialize(
        self,
        lessonid,
        pageid,
        password,
        returncontents,
        review,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_get_page_data'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_get_page_data'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_get_page_data',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if lessonid is not None:
            _form_params += parse_form({'lessonid': lessonid})
        if pageid is not None:
            _form_params += parse_form({'pageid': pageid})
        if password is not None:
            _form_params += parse_form({'password': password})
        if returncontents is not None:
            _form_params += parse_form({'returncontents': returncontents})
        if review is not None:
            _form_params += parse_form({'review': review})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_get_pages_args(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        password: Annotated[Optional[StrictStr], Field(description="optional password (the lesson may be protected)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the list of pages in a lesson (based on the user permissions).

        Return the list of pages in a lesson (based on the user permissions).

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param password: optional password (the lesson may be protected)
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_pages_serialize(
            lessonid=lessonid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetPagesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_get_pages(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        password: Annotated[Optional[StrictStr], Field(description="optional password (the lesson may be protected)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonGetPagesResponse:
        """Return the list of pages in a lesson (based on the user permissions).

        Return the list of pages in a lesson (based on the user permissions).

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param password: optional password (the lesson may be protected)
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_pages_serialize(
            lessonid=lessonid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetPagesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_pages_from_args(
        self,
        args
    ) -> ModLessonGetPagesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetPagesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_pages_with_http_info(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        password: Annotated[Optional[StrictStr], Field(description="optional password (the lesson may be protected)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonGetPagesResponse]:
        """Return the list of pages in a lesson (based on the user permissions).

        Return the list of pages in a lesson (based on the user permissions).

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param password: optional password (the lesson may be protected)
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_pages_serialize(
            lessonid=lessonid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetPagesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_get_pages_without_preload_content(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        password: Annotated[Optional[StrictStr], Field(description="optional password (the lesson may be protected)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the list of pages in a lesson (based on the user permissions).

        Return the list of pages in a lesson (based on the user permissions).

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param password: optional password (the lesson may be protected)
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_pages_serialize(
            lessonid=lessonid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetPagesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_get_pages_serialize(
        self,
        lessonid,
        password,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_get_pages'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_get_pages'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_get_pages',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if lessonid is not None:
            _form_params += parse_form({'lessonid': lessonid})
        if password is not None:
            _form_params += parse_form({'password': password})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_get_pages_possible_jumps_args(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return all the possible jumps for the pages in a given lesson.

        Return all the possible jumps for the pages in a given lesson.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_pages_possible_jumps_serialize(
            lessonid=lessonid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetPagesPossibleJumpsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_get_pages_possible_jumps(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonGetPagesPossibleJumpsResponse:
        """Return all the possible jumps for the pages in a given lesson.

        Return all the possible jumps for the pages in a given lesson.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_pages_possible_jumps_serialize(
            lessonid=lessonid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetPagesPossibleJumpsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_pages_possible_jumps_from_args(
        self,
        args
    ) -> ModLessonGetPagesPossibleJumpsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetPagesPossibleJumpsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_pages_possible_jumps_with_http_info(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonGetPagesPossibleJumpsResponse]:
        """Return all the possible jumps for the pages in a given lesson.

        Return all the possible jumps for the pages in a given lesson.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_pages_possible_jumps_serialize(
            lessonid=lessonid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetPagesPossibleJumpsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_get_pages_possible_jumps_without_preload_content(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return all the possible jumps for the pages in a given lesson.

        Return all the possible jumps for the pages in a given lesson.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_pages_possible_jumps_serialize(
            lessonid=lessonid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetPagesPossibleJumpsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_get_pages_possible_jumps_serialize(
        self,
        lessonid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_get_pages_possible_jumps'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_get_pages_possible_jumps'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_get_pages_possible_jumps',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if lessonid is not None:
            _form_params += parse_form({'lessonid': lessonid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_get_questions_attempts_args(
        self,
        attempt: Annotated[Optional[StrictInt], Field(description="lesson attempt number")],
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        correct: Annotated[Optional[StrictBool], Field(description="only fetch correct attempts")] = None,
        pageid: Annotated[Optional[StrictInt], Field(description="only fetch attempts at the given page")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="only fetch attempts of the given user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the list of questions attempts in a given lesson.

        Return the list of questions attempts in a given lesson.

        :param attempt: lesson attempt number (required)
        :type attempt: int
        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param correct: only fetch correct attempts
        :type correct: bool
        :param pageid: only fetch attempts at the given page
        :type pageid: int
        :param userid: only fetch attempts of the given user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_questions_attempts_serialize(
            attempt=attempt,
            lessonid=lessonid,
            correct=correct,
            pageid=pageid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetQuestionsAttemptsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_get_questions_attempts(
        self,
        attempt: Annotated[Optional[StrictInt], Field(description="lesson attempt number")],
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        correct: Annotated[Optional[StrictBool], Field(description="only fetch correct attempts")] = None,
        pageid: Annotated[Optional[StrictInt], Field(description="only fetch attempts at the given page")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="only fetch attempts of the given user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonGetQuestionsAttemptsResponse:
        """Return the list of questions attempts in a given lesson.

        Return the list of questions attempts in a given lesson.

        :param attempt: lesson attempt number (required)
        :type attempt: int
        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param correct: only fetch correct attempts
        :type correct: bool
        :param pageid: only fetch attempts at the given page
        :type pageid: int
        :param userid: only fetch attempts of the given user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_questions_attempts_serialize(
            attempt=attempt,
            lessonid=lessonid,
            correct=correct,
            pageid=pageid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetQuestionsAttemptsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_questions_attempts_from_args(
        self,
        args
    ) -> ModLessonGetQuestionsAttemptsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetQuestionsAttemptsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_questions_attempts_with_http_info(
        self,
        attempt: Annotated[Optional[StrictInt], Field(description="lesson attempt number")],
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        correct: Annotated[Optional[StrictBool], Field(description="only fetch correct attempts")] = None,
        pageid: Annotated[Optional[StrictInt], Field(description="only fetch attempts at the given page")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="only fetch attempts of the given user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonGetQuestionsAttemptsResponse]:
        """Return the list of questions attempts in a given lesson.

        Return the list of questions attempts in a given lesson.

        :param attempt: lesson attempt number (required)
        :type attempt: int
        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param correct: only fetch correct attempts
        :type correct: bool
        :param pageid: only fetch attempts at the given page
        :type pageid: int
        :param userid: only fetch attempts of the given user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_questions_attempts_serialize(
            attempt=attempt,
            lessonid=lessonid,
            correct=correct,
            pageid=pageid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetQuestionsAttemptsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_get_questions_attempts_without_preload_content(
        self,
        attempt: Annotated[Optional[StrictInt], Field(description="lesson attempt number")],
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        correct: Annotated[Optional[StrictBool], Field(description="only fetch correct attempts")] = None,
        pageid: Annotated[Optional[StrictInt], Field(description="only fetch attempts at the given page")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="only fetch attempts of the given user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the list of questions attempts in a given lesson.

        Return the list of questions attempts in a given lesson.

        :param attempt: lesson attempt number (required)
        :type attempt: int
        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param correct: only fetch correct attempts
        :type correct: bool
        :param pageid: only fetch attempts at the given page
        :type pageid: int
        :param userid: only fetch attempts of the given user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_questions_attempts_serialize(
            attempt=attempt,
            lessonid=lessonid,
            correct=correct,
            pageid=pageid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetQuestionsAttemptsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_get_questions_attempts_serialize(
        self,
        attempt,
        lessonid,
        correct,
        pageid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_get_questions_attempts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_get_questions_attempts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_get_questions_attempts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attempt is not None:
            _form_params += parse_form({'attempt': attempt})
        if correct is not None:
            _form_params += parse_form({'correct': correct})
        if lessonid is not None:
            _form_params += parse_form({'lessonid': lessonid})
        if pageid is not None:
            _form_params += parse_form({'pageid': pageid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_get_user_attempt_args(
        self,
        lessonattempt: Annotated[Optional[StrictInt], Field(description="The attempt number.")],
        lessonid: Annotated[Optional[StrictInt], Field(description="Lesson instance id.")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id. 0 for current user.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return information about the given user attempt (including answers).

        Return information about the given user attempt (including answers).

        :param lessonattempt: The attempt number. (required)
        :type lessonattempt: int
        :param lessonid: Lesson instance id. (required)
        :type lessonid: int
        :param userid: The user id. 0 for current user. (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_user_attempt_serialize(
            lessonattempt=lessonattempt,
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserAttemptResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_get_user_attempt(
        self,
        lessonattempt: Annotated[Optional[StrictInt], Field(description="The attempt number.")],
        lessonid: Annotated[Optional[StrictInt], Field(description="Lesson instance id.")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id. 0 for current user.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonGetUserAttemptResponse:
        """Return information about the given user attempt (including answers).

        Return information about the given user attempt (including answers).

        :param lessonattempt: The attempt number. (required)
        :type lessonattempt: int
        :param lessonid: Lesson instance id. (required)
        :type lessonid: int
        :param userid: The user id. 0 for current user. (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_user_attempt_serialize(
            lessonattempt=lessonattempt,
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_user_attempt_from_args(
        self,
        args
    ) -> ModLessonGetUserAttemptResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserAttemptResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_user_attempt_with_http_info(
        self,
        lessonattempt: Annotated[Optional[StrictInt], Field(description="The attempt number.")],
        lessonid: Annotated[Optional[StrictInt], Field(description="Lesson instance id.")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id. 0 for current user.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonGetUserAttemptResponse]:
        """Return information about the given user attempt (including answers).

        Return information about the given user attempt (including answers).

        :param lessonattempt: The attempt number. (required)
        :type lessonattempt: int
        :param lessonid: Lesson instance id. (required)
        :type lessonid: int
        :param userid: The user id. 0 for current user. (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_user_attempt_serialize(
            lessonattempt=lessonattempt,
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_get_user_attempt_without_preload_content(
        self,
        lessonattempt: Annotated[Optional[StrictInt], Field(description="The attempt number.")],
        lessonid: Annotated[Optional[StrictInt], Field(description="Lesson instance id.")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id. 0 for current user.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return information about the given user attempt (including answers).

        Return information about the given user attempt (including answers).

        :param lessonattempt: The attempt number. (required)
        :type lessonattempt: int
        :param lessonid: Lesson instance id. (required)
        :type lessonid: int
        :param userid: The user id. 0 for current user. (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_user_attempt_serialize(
            lessonattempt=lessonattempt,
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_get_user_attempt_serialize(
        self,
        lessonattempt,
        lessonid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_get_user_attempt'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_get_user_attempt'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_get_user_attempt',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if lessonattempt is not None:
            _form_params += parse_form({'lessonattempt': lessonattempt})
        if lessonid is not None:
            _form_params += parse_form({'lessonid': lessonid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_get_user_attempt_grade_args(
        self,
        lessonattempt: Annotated[Optional[StrictInt], Field(description="lesson attempt number")],
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="the user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return grade information in the attempt for a given user.

        Return grade information in the attempt for a given user.

        :param lessonattempt: lesson attempt number (required)
        :type lessonattempt: int
        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param userid: the user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_user_attempt_grade_serialize(
            lessonattempt=lessonattempt,
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserAttemptGradeResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_get_user_attempt_grade(
        self,
        lessonattempt: Annotated[Optional[StrictInt], Field(description="lesson attempt number")],
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="the user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonGetUserAttemptGradeResponse:
        """Return grade information in the attempt for a given user.

        Return grade information in the attempt for a given user.

        :param lessonattempt: lesson attempt number (required)
        :type lessonattempt: int
        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param userid: the user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_user_attempt_grade_serialize(
            lessonattempt=lessonattempt,
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserAttemptGradeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_user_attempt_grade_from_args(
        self,
        args
    ) -> ModLessonGetUserAttemptGradeResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserAttemptGradeResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_user_attempt_grade_with_http_info(
        self,
        lessonattempt: Annotated[Optional[StrictInt], Field(description="lesson attempt number")],
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="the user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonGetUserAttemptGradeResponse]:
        """Return grade information in the attempt for a given user.

        Return grade information in the attempt for a given user.

        :param lessonattempt: lesson attempt number (required)
        :type lessonattempt: int
        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param userid: the user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_user_attempt_grade_serialize(
            lessonattempt=lessonattempt,
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserAttemptGradeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_get_user_attempt_grade_without_preload_content(
        self,
        lessonattempt: Annotated[Optional[StrictInt], Field(description="lesson attempt number")],
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="the user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return grade information in the attempt for a given user.

        Return grade information in the attempt for a given user.

        :param lessonattempt: lesson attempt number (required)
        :type lessonattempt: int
        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param userid: the user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_user_attempt_grade_serialize(
            lessonattempt=lessonattempt,
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserAttemptGradeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_get_user_attempt_grade_serialize(
        self,
        lessonattempt,
        lessonid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_get_user_attempt_grade'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_get_user_attempt_grade'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_get_user_attempt_grade',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if lessonattempt is not None:
            _form_params += parse_form({'lessonattempt': lessonattempt})
        if lessonid is not None:
            _form_params += parse_form({'lessonid': lessonid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_get_user_grade_args(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="the user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the final grade in the lesson for the given user.

        Return the final grade in the lesson for the given user.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param userid: the user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_user_grade_serialize(
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserGradeResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_get_user_grade(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="the user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonGetUserGradeResponse:
        """Return the final grade in the lesson for the given user.

        Return the final grade in the lesson for the given user.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param userid: the user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_user_grade_serialize(
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserGradeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_user_grade_from_args(
        self,
        args
    ) -> ModLessonGetUserGradeResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserGradeResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_user_grade_with_http_info(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="the user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonGetUserGradeResponse]:
        """Return the final grade in the lesson for the given user.

        Return the final grade in the lesson for the given user.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param userid: the user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_user_grade_serialize(
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserGradeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_get_user_grade_without_preload_content(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="the user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the final grade in the lesson for the given user.

        Return the final grade in the lesson for the given user.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param userid: the user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_user_grade_serialize(
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserGradeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_get_user_grade_serialize(
        self,
        lessonid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_get_user_grade'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_get_user_grade'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_get_user_grade',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if lessonid is not None:
            _form_params += parse_form({'lessonid': lessonid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_get_user_timers_args(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="the user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the timers in the current lesson for the given user.

        Return the timers in the current lesson for the given user.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param userid: the user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_user_timers_serialize(
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserTimersResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_get_user_timers(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="the user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonGetUserTimersResponse:
        """Return the timers in the current lesson for the given user.

        Return the timers in the current lesson for the given user.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param userid: the user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_user_timers_serialize(
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserTimersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_user_timers_from_args(
        self,
        args
    ) -> ModLessonGetUserTimersResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserTimersResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_get_user_timers_with_http_info(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="the user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonGetUserTimersResponse]:
        """Return the timers in the current lesson for the given user.

        Return the timers in the current lesson for the given user.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param userid: the user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_user_timers_serialize(
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserTimersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_get_user_timers_without_preload_content(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="the user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the timers in the current lesson for the given user.

        Return the timers in the current lesson for the given user.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param userid: the user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_get_user_timers_serialize(
            lessonid=lessonid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonGetUserTimersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_get_user_timers_serialize(
        self,
        lessonid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_get_user_timers'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_get_user_timers'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_get_user_timers',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if lessonid is not None:
            _form_params += parse_form({'lessonid': lessonid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_launch_attempt_args(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        pageid: Annotated[Optional[StrictInt], Field(description="page id to continue from (only when continuing an attempt)")] = None,
        password: Annotated[Optional[StrictStr], Field(description="optional password (the lesson may be protected)")] = None,
        review: Annotated[Optional[StrictBool], Field(description="if we want to review just after finishing")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Starts a new attempt or continues an existing one.

        Starts a new attempt or continues an existing one.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param pageid: page id to continue from (only when continuing an attempt)
        :type pageid: int
        :param password: optional password (the lesson may be protected)
        :type password: str
        :param review: if we want to review just after finishing
        :type review: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_launch_attempt_serialize(
            lessonid=lessonid,
            pageid=pageid,
            password=password,
            review=review,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonLaunchAttemptResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_launch_attempt(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        pageid: Annotated[Optional[StrictInt], Field(description="page id to continue from (only when continuing an attempt)")] = None,
        password: Annotated[Optional[StrictStr], Field(description="optional password (the lesson may be protected)")] = None,
        review: Annotated[Optional[StrictBool], Field(description="if we want to review just after finishing")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonLaunchAttemptResponse:
        """Starts a new attempt or continues an existing one.

        Starts a new attempt or continues an existing one.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param pageid: page id to continue from (only when continuing an attempt)
        :type pageid: int
        :param password: optional password (the lesson may be protected)
        :type password: str
        :param review: if we want to review just after finishing
        :type review: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_launch_attempt_serialize(
            lessonid=lessonid,
            pageid=pageid,
            password=password,
            review=review,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonLaunchAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_launch_attempt_from_args(
        self,
        args
    ) -> ModLessonLaunchAttemptResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonLaunchAttemptResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_launch_attempt_with_http_info(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        pageid: Annotated[Optional[StrictInt], Field(description="page id to continue from (only when continuing an attempt)")] = None,
        password: Annotated[Optional[StrictStr], Field(description="optional password (the lesson may be protected)")] = None,
        review: Annotated[Optional[StrictBool], Field(description="if we want to review just after finishing")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonLaunchAttemptResponse]:
        """Starts a new attempt or continues an existing one.

        Starts a new attempt or continues an existing one.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param pageid: page id to continue from (only when continuing an attempt)
        :type pageid: int
        :param password: optional password (the lesson may be protected)
        :type password: str
        :param review: if we want to review just after finishing
        :type review: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_launch_attempt_serialize(
            lessonid=lessonid,
            pageid=pageid,
            password=password,
            review=review,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonLaunchAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_launch_attempt_without_preload_content(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        pageid: Annotated[Optional[StrictInt], Field(description="page id to continue from (only when continuing an attempt)")] = None,
        password: Annotated[Optional[StrictStr], Field(description="optional password (the lesson may be protected)")] = None,
        review: Annotated[Optional[StrictBool], Field(description="if we want to review just after finishing")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Starts a new attempt or continues an existing one.

        Starts a new attempt or continues an existing one.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param pageid: page id to continue from (only when continuing an attempt)
        :type pageid: int
        :param password: optional password (the lesson may be protected)
        :type password: str
        :param review: if we want to review just after finishing
        :type review: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_launch_attempt_serialize(
            lessonid=lessonid,
            pageid=pageid,
            password=password,
            review=review,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonLaunchAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_launch_attempt_serialize(
        self,
        lessonid,
        pageid,
        password,
        review,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_launch_attempt'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_launch_attempt'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_launch_attempt',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if lessonid is not None:
            _form_params += parse_form({'lessonid': lessonid})
        if pageid is not None:
            _form_params += parse_form({'pageid': pageid})
        if password is not None:
            _form_params += parse_form({'password': password})
        if review is not None:
            _form_params += parse_form({'review': review})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_process_page_args(
        self,
        data: Annotated[List[ModLessonProcessPageParametersDataInner], Field(description="the data to be saved")],
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        pageid: Annotated[Optional[StrictInt], Field(description="the page id")],
        password: Annotated[Optional[StrictStr], Field(description="optional password (the lesson may be protected)")] = None,
        review: Annotated[Optional[StrictBool], Field(description="if we want to review just after finishing (1 hour margin)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Processes page responses.

        Processes page responses.

        :param data: the data to be saved (required)
        :type data: List[ModLessonProcessPageParametersDataInner]
        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param pageid: the page id (required)
        :type pageid: int
        :param password: optional password (the lesson may be protected)
        :type password: str
        :param review: if we want to review just after finishing (1 hour margin)
        :type review: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_process_page_serialize(
            data=data,
            lessonid=lessonid,
            pageid=pageid,
            password=password,
            review=review,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonProcessPageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_process_page(
        self,
        data: Annotated[List[ModLessonProcessPageParametersDataInner], Field(description="the data to be saved")],
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        pageid: Annotated[Optional[StrictInt], Field(description="the page id")],
        password: Annotated[Optional[StrictStr], Field(description="optional password (the lesson may be protected)")] = None,
        review: Annotated[Optional[StrictBool], Field(description="if we want to review just after finishing (1 hour margin)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonProcessPageResponse:
        """Processes page responses.

        Processes page responses.

        :param data: the data to be saved (required)
        :type data: List[ModLessonProcessPageParametersDataInner]
        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param pageid: the page id (required)
        :type pageid: int
        :param password: optional password (the lesson may be protected)
        :type password: str
        :param review: if we want to review just after finishing (1 hour margin)
        :type review: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_process_page_serialize(
            data=data,
            lessonid=lessonid,
            pageid=pageid,
            password=password,
            review=review,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonProcessPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_process_page_from_args(
        self,
        args
    ) -> ModLessonProcessPageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonProcessPageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_process_page_with_http_info(
        self,
        data: Annotated[List[ModLessonProcessPageParametersDataInner], Field(description="the data to be saved")],
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        pageid: Annotated[Optional[StrictInt], Field(description="the page id")],
        password: Annotated[Optional[StrictStr], Field(description="optional password (the lesson may be protected)")] = None,
        review: Annotated[Optional[StrictBool], Field(description="if we want to review just after finishing (1 hour margin)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonProcessPageResponse]:
        """Processes page responses.

        Processes page responses.

        :param data: the data to be saved (required)
        :type data: List[ModLessonProcessPageParametersDataInner]
        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param pageid: the page id (required)
        :type pageid: int
        :param password: optional password (the lesson may be protected)
        :type password: str
        :param review: if we want to review just after finishing (1 hour margin)
        :type review: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_process_page_serialize(
            data=data,
            lessonid=lessonid,
            pageid=pageid,
            password=password,
            review=review,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonProcessPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_process_page_without_preload_content(
        self,
        data: Annotated[List[ModLessonProcessPageParametersDataInner], Field(description="the data to be saved")],
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        pageid: Annotated[Optional[StrictInt], Field(description="the page id")],
        password: Annotated[Optional[StrictStr], Field(description="optional password (the lesson may be protected)")] = None,
        review: Annotated[Optional[StrictBool], Field(description="if we want to review just after finishing (1 hour margin)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Processes page responses.

        Processes page responses.

        :param data: the data to be saved (required)
        :type data: List[ModLessonProcessPageParametersDataInner]
        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param pageid: the page id (required)
        :type pageid: int
        :param password: optional password (the lesson may be protected)
        :type password: str
        :param review: if we want to review just after finishing (1 hour margin)
        :type review: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_process_page_serialize(
            data=data,
            lessonid=lessonid,
            pageid=pageid,
            password=password,
            review=review,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonProcessPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_process_page_serialize(
        self,
        data,
        lessonid,
        pageid,
        password,
        review,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'data': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_process_page'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_process_page'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_process_page',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if data is not None:
            _form_params += parse_form({'data': data})
        if lessonid is not None:
            _form_params += parse_form({'lessonid': lessonid})
        if pageid is not None:
            _form_params += parse_form({'pageid': pageid})
        if password is not None:
            _form_params += parse_form({'password': password})
        if review is not None:
            _form_params += parse_form({'review': review})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lesson_view_lesson_args(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        password: Annotated[Optional[StrictStr], Field(description="lesson password")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param password: lesson password
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_view_lesson_serialize(
            lessonid=lessonid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonViewLessonResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lesson_view_lesson(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        password: Annotated[Optional[StrictStr], Field(description="lesson password")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLessonViewLessonResponse:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param password: lesson password
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_view_lesson_serialize(
            lessonid=lessonid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonViewLessonResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_view_lesson_from_args(
        self,
        args
    ) -> ModLessonViewLessonResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonViewLessonResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lesson_view_lesson_with_http_info(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        password: Annotated[Optional[StrictStr], Field(description="lesson password")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLessonViewLessonResponse]:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param password: lesson password
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_view_lesson_serialize(
            lessonid=lessonid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonViewLessonResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lesson_view_lesson_without_preload_content(
        self,
        lessonid: Annotated[Optional[StrictInt], Field(description="lesson instance id")],
        password: Annotated[Optional[StrictStr], Field(description="lesson password")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param lessonid: lesson instance id (required)
        :type lessonid: int
        :param password: lesson password
        :type password: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lesson_view_lesson_serialize(
            lessonid=lessonid,
            password=password,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLessonViewLessonResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lesson_view_lesson_serialize(
        self,
        lessonid,
        password,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lesson_view_lesson'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lesson_view_lesson'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lesson_view_lesson',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if lessonid is not None:
            _form_params += parse_form({'lessonid': lessonid})
        if password is not None:
            _form_params += parse_form({'password': password})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lti_create_tool_proxy_args(
        self,
        regurl: Annotated[Optional[StrictStr], Field(description="Tool proxy registration URL")],
        capabilityoffered: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Array of capabilities")] = None,
        name: Annotated[Optional[StrictStr], Field(description="Tool proxy name")] = None,
        serviceoffered: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Array of services")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Create a tool proxy

        Create a tool proxy

        :param regurl: Tool proxy registration URL (required)
        :type regurl: str
        :param capabilityoffered: Array of capabilities
        :type capabilityoffered: List[Optional[str]]
        :param name: Tool proxy name
        :type name: str
        :param serviceoffered: Array of services
        :type serviceoffered: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_create_tool_proxy_serialize(
            regurl=regurl,
            capabilityoffered=capabilityoffered,
            name=name,
            serviceoffered=serviceoffered,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiCreateToolProxyResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lti_create_tool_proxy(
        self,
        regurl: Annotated[Optional[StrictStr], Field(description="Tool proxy registration URL")],
        capabilityoffered: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Array of capabilities")] = None,
        name: Annotated[Optional[StrictStr], Field(description="Tool proxy name")] = None,
        serviceoffered: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Array of services")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLtiCreateToolProxyResponse:
        """Create a tool proxy

        Create a tool proxy

        :param regurl: Tool proxy registration URL (required)
        :type regurl: str
        :param capabilityoffered: Array of capabilities
        :type capabilityoffered: List[Optional[str]]
        :param name: Tool proxy name
        :type name: str
        :param serviceoffered: Array of services
        :type serviceoffered: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_create_tool_proxy_serialize(
            regurl=regurl,
            capabilityoffered=capabilityoffered,
            name=name,
            serviceoffered=serviceoffered,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiCreateToolProxyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_create_tool_proxy_from_args(
        self,
        args
    ) -> ModLtiCreateToolProxyResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiCreateToolProxyResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_create_tool_proxy_with_http_info(
        self,
        regurl: Annotated[Optional[StrictStr], Field(description="Tool proxy registration URL")],
        capabilityoffered: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Array of capabilities")] = None,
        name: Annotated[Optional[StrictStr], Field(description="Tool proxy name")] = None,
        serviceoffered: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Array of services")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLtiCreateToolProxyResponse]:
        """Create a tool proxy

        Create a tool proxy

        :param regurl: Tool proxy registration URL (required)
        :type regurl: str
        :param capabilityoffered: Array of capabilities
        :type capabilityoffered: List[Optional[str]]
        :param name: Tool proxy name
        :type name: str
        :param serviceoffered: Array of services
        :type serviceoffered: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_create_tool_proxy_serialize(
            regurl=regurl,
            capabilityoffered=capabilityoffered,
            name=name,
            serviceoffered=serviceoffered,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiCreateToolProxyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lti_create_tool_proxy_without_preload_content(
        self,
        regurl: Annotated[Optional[StrictStr], Field(description="Tool proxy registration URL")],
        capabilityoffered: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Array of capabilities")] = None,
        name: Annotated[Optional[StrictStr], Field(description="Tool proxy name")] = None,
        serviceoffered: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Array of services")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create a tool proxy

        Create a tool proxy

        :param regurl: Tool proxy registration URL (required)
        :type regurl: str
        :param capabilityoffered: Array of capabilities
        :type capabilityoffered: List[Optional[str]]
        :param name: Tool proxy name
        :type name: str
        :param serviceoffered: Array of services
        :type serviceoffered: List[Optional[str]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_create_tool_proxy_serialize(
            regurl=regurl,
            capabilityoffered=capabilityoffered,
            name=name,
            serviceoffered=serviceoffered,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiCreateToolProxyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lti_create_tool_proxy_serialize(
        self,
        regurl,
        capabilityoffered,
        name,
        serviceoffered,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'capabilityoffered': 'csv',
            'serviceoffered': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_lti_create_tool_proxy'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lti_create_tool_proxy'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lti_create_tool_proxy',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if capabilityoffered is not None:
            _form_params += parse_form({'capabilityoffered': capabilityoffered})
        if name is not None:
            _form_params += parse_form({'name': name})
        if regurl is not None:
            _form_params += parse_form({'regurl': regurl})
        if serviceoffered is not None:
            _form_params += parse_form({'serviceoffered': serviceoffered})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lti_create_tool_type_args(
        self,
        cartridgeurl: Annotated[Optional[StrictStr], Field(description="URL to cardridge to load tool information")] = None,
        key: Annotated[Optional[StrictStr], Field(description="Consumer key")] = None,
        secret: Annotated[Optional[StrictStr], Field(description="Shared secret")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Create a tool type

        Create a tool type

        :param cartridgeurl: URL to cardridge to load tool information
        :type cartridgeurl: str
        :param key: Consumer key
        :type key: str
        :param secret: Shared secret
        :type secret: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_create_tool_type_serialize(
            cartridgeurl=cartridgeurl,
            key=key,
            secret=secret,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiCreateToolTypeResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lti_create_tool_type(
        self,
        cartridgeurl: Annotated[Optional[StrictStr], Field(description="URL to cardridge to load tool information")] = None,
        key: Annotated[Optional[StrictStr], Field(description="Consumer key")] = None,
        secret: Annotated[Optional[StrictStr], Field(description="Shared secret")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLtiCreateToolTypeResponse:
        """Create a tool type

        Create a tool type

        :param cartridgeurl: URL to cardridge to load tool information
        :type cartridgeurl: str
        :param key: Consumer key
        :type key: str
        :param secret: Shared secret
        :type secret: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_create_tool_type_serialize(
            cartridgeurl=cartridgeurl,
            key=key,
            secret=secret,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiCreateToolTypeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_create_tool_type_from_args(
        self,
        args
    ) -> ModLtiCreateToolTypeResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiCreateToolTypeResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_create_tool_type_with_http_info(
        self,
        cartridgeurl: Annotated[Optional[StrictStr], Field(description="URL to cardridge to load tool information")] = None,
        key: Annotated[Optional[StrictStr], Field(description="Consumer key")] = None,
        secret: Annotated[Optional[StrictStr], Field(description="Shared secret")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLtiCreateToolTypeResponse]:
        """Create a tool type

        Create a tool type

        :param cartridgeurl: URL to cardridge to load tool information
        :type cartridgeurl: str
        :param key: Consumer key
        :type key: str
        :param secret: Shared secret
        :type secret: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_create_tool_type_serialize(
            cartridgeurl=cartridgeurl,
            key=key,
            secret=secret,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiCreateToolTypeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lti_create_tool_type_without_preload_content(
        self,
        cartridgeurl: Annotated[Optional[StrictStr], Field(description="URL to cardridge to load tool information")] = None,
        key: Annotated[Optional[StrictStr], Field(description="Consumer key")] = None,
        secret: Annotated[Optional[StrictStr], Field(description="Shared secret")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create a tool type

        Create a tool type

        :param cartridgeurl: URL to cardridge to load tool information
        :type cartridgeurl: str
        :param key: Consumer key
        :type key: str
        :param secret: Shared secret
        :type secret: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_create_tool_type_serialize(
            cartridgeurl=cartridgeurl,
            key=key,
            secret=secret,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiCreateToolTypeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lti_create_tool_type_serialize(
        self,
        cartridgeurl,
        key,
        secret,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lti_create_tool_type'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lti_create_tool_type'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lti_create_tool_type',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cartridgeurl is not None:
            _form_params += parse_form({'cartridgeurl': cartridgeurl})
        if key is not None:
            _form_params += parse_form({'key': key})
        if secret is not None:
            _form_params += parse_form({'secret': secret})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lti_delete_course_tool_type_args(
        self,
        tooltypeid: Annotated[Optional[StrictInt], Field(description="Tool type ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete a course tool type

        Delete a course tool type

        :param tooltypeid: Tool type ID (required)
        :type tooltypeid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_delete_course_tool_type_serialize(
            tooltypeid=tooltypeid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lti_delete_course_tool_type(
        self,
        tooltypeid: Annotated[Optional[StrictInt], Field(description="Tool type ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Delete a course tool type

        Delete a course tool type

        :param tooltypeid: Tool type ID (required)
        :type tooltypeid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_delete_course_tool_type_serialize(
            tooltypeid=tooltypeid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_delete_course_tool_type_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_delete_course_tool_type_with_http_info(
        self,
        tooltypeid: Annotated[Optional[StrictInt], Field(description="Tool type ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Delete a course tool type

        Delete a course tool type

        :param tooltypeid: Tool type ID (required)
        :type tooltypeid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_delete_course_tool_type_serialize(
            tooltypeid=tooltypeid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lti_delete_course_tool_type_without_preload_content(
        self,
        tooltypeid: Annotated[Optional[StrictInt], Field(description="Tool type ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete a course tool type

        Delete a course tool type

        :param tooltypeid: Tool type ID (required)
        :type tooltypeid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_delete_course_tool_type_serialize(
            tooltypeid=tooltypeid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lti_delete_course_tool_type_serialize(
        self,
        tooltypeid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lti_delete_course_tool_type'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lti_delete_course_tool_type'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lti_delete_course_tool_type',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if tooltypeid is not None:
            _form_params += parse_form({'tooltypeid': tooltypeid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lti_delete_tool_proxy_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Tool proxy id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete a tool proxy

        Delete a tool proxy

        :param id: Tool proxy id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_delete_tool_proxy_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiDeleteToolProxyResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lti_delete_tool_proxy(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Tool proxy id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLtiDeleteToolProxyResponse:
        """Delete a tool proxy

        Delete a tool proxy

        :param id: Tool proxy id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_delete_tool_proxy_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiDeleteToolProxyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_delete_tool_proxy_from_args(
        self,
        args
    ) -> ModLtiDeleteToolProxyResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiDeleteToolProxyResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_delete_tool_proxy_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Tool proxy id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLtiDeleteToolProxyResponse]:
        """Delete a tool proxy

        Delete a tool proxy

        :param id: Tool proxy id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_delete_tool_proxy_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiDeleteToolProxyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lti_delete_tool_proxy_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Tool proxy id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete a tool proxy

        Delete a tool proxy

        :param id: Tool proxy id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_delete_tool_proxy_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiDeleteToolProxyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lti_delete_tool_proxy_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lti_delete_tool_proxy'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lti_delete_tool_proxy'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lti_delete_tool_proxy',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lti_delete_tool_type_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Tool type id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete a tool type

        Delete a tool type

        :param id: Tool type id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_delete_tool_type_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiDeleteToolTypeResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lti_delete_tool_type(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Tool type id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLtiDeleteToolTypeResponse:
        """Delete a tool type

        Delete a tool type

        :param id: Tool type id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_delete_tool_type_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiDeleteToolTypeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_delete_tool_type_from_args(
        self,
        args
    ) -> ModLtiDeleteToolTypeResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiDeleteToolTypeResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_delete_tool_type_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Tool type id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLtiDeleteToolTypeResponse]:
        """Delete a tool type

        Delete a tool type

        :param id: Tool type id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_delete_tool_type_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiDeleteToolTypeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lti_delete_tool_type_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Tool type id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete a tool type

        Delete a tool type

        :param id: Tool type id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_delete_tool_type_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiDeleteToolTypeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lti_delete_tool_type_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lti_delete_tool_type'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lti_delete_tool_type'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lti_delete_tool_type',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lti_get_ltis_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of external tool instances in a provided set of courses, if                             no courses are provided then all the external tool instances the user has access to will be returned.

        Returns a list of external tool instances in a provided set of courses, if                             no courses are provided then all the external tool instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_ltis_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetLtisByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lti_get_ltis_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLtiGetLtisByCoursesResponse:
        """Returns a list of external tool instances in a provided set of courses, if                             no courses are provided then all the external tool instances the user has access to will be returned.

        Returns a list of external tool instances in a provided set of courses, if                             no courses are provided then all the external tool instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_ltis_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetLtisByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_get_ltis_by_courses_from_args(
        self,
        args
    ) -> ModLtiGetLtisByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetLtisByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_get_ltis_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLtiGetLtisByCoursesResponse]:
        """Returns a list of external tool instances in a provided set of courses, if                             no courses are provided then all the external tool instances the user has access to will be returned.

        Returns a list of external tool instances in a provided set of courses, if                             no courses are provided then all the external tool instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_ltis_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetLtisByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lti_get_ltis_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of external tool instances in a provided set of courses, if                             no courses are provided then all the external tool instances the user has access to will be returned.

        Returns a list of external tool instances in a provided set of courses, if                             no courses are provided then all the external tool instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_ltis_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetLtisByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lti_get_ltis_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_lti_get_ltis_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lti_get_ltis_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lti_get_ltis_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lti_get_tool_launch_data_args(
        self,
        toolid: Annotated[Optional[StrictInt], Field(description="external tool instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the launch data for a given external tool.

        Return the launch data for a given external tool.

        :param toolid: external tool instance id (required)
        :type toolid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_launch_data_serialize(
            toolid=toolid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolLaunchDataResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lti_get_tool_launch_data(
        self,
        toolid: Annotated[Optional[StrictInt], Field(description="external tool instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLtiGetToolLaunchDataResponse:
        """Return the launch data for a given external tool.

        Return the launch data for a given external tool.

        :param toolid: external tool instance id (required)
        :type toolid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_launch_data_serialize(
            toolid=toolid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolLaunchDataResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_get_tool_launch_data_from_args(
        self,
        args
    ) -> ModLtiGetToolLaunchDataResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolLaunchDataResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_get_tool_launch_data_with_http_info(
        self,
        toolid: Annotated[Optional[StrictInt], Field(description="external tool instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLtiGetToolLaunchDataResponse]:
        """Return the launch data for a given external tool.

        Return the launch data for a given external tool.

        :param toolid: external tool instance id (required)
        :type toolid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_launch_data_serialize(
            toolid=toolid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolLaunchDataResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lti_get_tool_launch_data_without_preload_content(
        self,
        toolid: Annotated[Optional[StrictInt], Field(description="external tool instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the launch data for a given external tool.

        Return the launch data for a given external tool.

        :param toolid: external tool instance id (required)
        :type toolid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_launch_data_serialize(
            toolid=toolid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolLaunchDataResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lti_get_tool_launch_data_serialize(
        self,
        toolid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lti_get_tool_launch_data'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lti_get_tool_launch_data'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lti_get_tool_launch_data',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if toolid is not None:
            _form_params += parse_form({'toolid': toolid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lti_get_tool_proxies_args(
        self,
        orphanedonly: Annotated[Optional[StrictBool], Field(description="Orphaned tool types only")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get a list of the tool proxies

        Get a list of the tool proxies

        :param orphanedonly: Orphaned tool types only
        :type orphanedonly: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_proxies_serialize(
            orphanedonly=orphanedonly,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModLtiGetToolProxiesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lti_get_tool_proxies(
        self,
        orphanedonly: Annotated[Optional[StrictBool], Field(description="Orphaned tool types only")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[ModLtiGetToolProxiesResponseInner]:
        """Get a list of the tool proxies

        Get a list of the tool proxies

        :param orphanedonly: Orphaned tool types only
        :type orphanedonly: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_proxies_serialize(
            orphanedonly=orphanedonly,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModLtiGetToolProxiesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_get_tool_proxies_from_args(
        self,
        args
    ) -> List[ModLtiGetToolProxiesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModLtiGetToolProxiesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_get_tool_proxies_with_http_info(
        self,
        orphanedonly: Annotated[Optional[StrictBool], Field(description="Orphaned tool types only")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[ModLtiGetToolProxiesResponseInner]]:
        """Get a list of the tool proxies

        Get a list of the tool proxies

        :param orphanedonly: Orphaned tool types only
        :type orphanedonly: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_proxies_serialize(
            orphanedonly=orphanedonly,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModLtiGetToolProxiesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lti_get_tool_proxies_without_preload_content(
        self,
        orphanedonly: Annotated[Optional[StrictBool], Field(description="Orphaned tool types only")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get a list of the tool proxies

        Get a list of the tool proxies

        :param orphanedonly: Orphaned tool types only
        :type orphanedonly: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_proxies_serialize(
            orphanedonly=orphanedonly,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModLtiGetToolProxiesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lti_get_tool_proxies_serialize(
        self,
        orphanedonly,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lti_get_tool_proxies'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lti_get_tool_proxies'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lti_get_tool_proxies',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if orphanedonly is not None:
            _form_params += parse_form({'orphanedonly': orphanedonly})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lti_get_tool_proxy_registration_request_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Tool proxy id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get a registration request for a tool proxy

        Get a registration request for a tool proxy

        :param id: Tool proxy id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_proxy_registration_request_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolProxyRegistrationRequestResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lti_get_tool_proxy_registration_request(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Tool proxy id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLtiGetToolProxyRegistrationRequestResponse:
        """Get a registration request for a tool proxy

        Get a registration request for a tool proxy

        :param id: Tool proxy id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_proxy_registration_request_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolProxyRegistrationRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_get_tool_proxy_registration_request_from_args(
        self,
        args
    ) -> ModLtiGetToolProxyRegistrationRequestResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolProxyRegistrationRequestResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_get_tool_proxy_registration_request_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Tool proxy id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLtiGetToolProxyRegistrationRequestResponse]:
        """Get a registration request for a tool proxy

        Get a registration request for a tool proxy

        :param id: Tool proxy id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_proxy_registration_request_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolProxyRegistrationRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lti_get_tool_proxy_registration_request_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Tool proxy id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get a registration request for a tool proxy

        Get a registration request for a tool proxy

        :param id: Tool proxy id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_proxy_registration_request_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolProxyRegistrationRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lti_get_tool_proxy_registration_request_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lti_get_tool_proxy_registration_request'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lti_get_tool_proxy_registration_request'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lti_get_tool_proxy_registration_request',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lti_get_tool_types_args(
        self,
        toolproxyid: Annotated[Optional[StrictInt], Field(description="Tool proxy id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get a list of the tool types

        Get a list of the tool types

        :param toolproxyid: Tool proxy id
        :type toolproxyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_types_serialize(
            toolproxyid=toolproxyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModLtiGetToolTypesAndProxiesResponseTypesInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lti_get_tool_types(
        self,
        toolproxyid: Annotated[Optional[StrictInt], Field(description="Tool proxy id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[ModLtiGetToolTypesAndProxiesResponseTypesInner]:
        """Get a list of the tool types

        Get a list of the tool types

        :param toolproxyid: Tool proxy id
        :type toolproxyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_types_serialize(
            toolproxyid=toolproxyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModLtiGetToolTypesAndProxiesResponseTypesInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_get_tool_types_from_args(
        self,
        args
    ) -> List[ModLtiGetToolTypesAndProxiesResponseTypesInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModLtiGetToolTypesAndProxiesResponseTypesInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_get_tool_types_with_http_info(
        self,
        toolproxyid: Annotated[Optional[StrictInt], Field(description="Tool proxy id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[ModLtiGetToolTypesAndProxiesResponseTypesInner]]:
        """Get a list of the tool types

        Get a list of the tool types

        :param toolproxyid: Tool proxy id
        :type toolproxyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_types_serialize(
            toolproxyid=toolproxyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModLtiGetToolTypesAndProxiesResponseTypesInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lti_get_tool_types_without_preload_content(
        self,
        toolproxyid: Annotated[Optional[StrictInt], Field(description="Tool proxy id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get a list of the tool types

        Get a list of the tool types

        :param toolproxyid: Tool proxy id
        :type toolproxyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_types_serialize(
            toolproxyid=toolproxyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ModLtiGetToolTypesAndProxiesResponseTypesInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lti_get_tool_types_serialize(
        self,
        toolproxyid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lti_get_tool_types'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lti_get_tool_types'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lti_get_tool_types',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if toolproxyid is not None:
            _form_params += parse_form({'toolproxyid': toolproxyid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lti_get_tool_types_and_proxies_args(
        self,
        limit: Annotated[Optional[StrictInt], Field(description="How many tool types displayed per page")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Current offset of tool elements")] = None,
        orphanedonly: Annotated[Optional[StrictBool], Field(description="Orphaned tool types only")] = None,
        toolproxyid: Annotated[Optional[StrictInt], Field(description="Tool proxy id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get a list of the tool types and tool proxies

        Get a list of the tool types and tool proxies

        :param limit: How many tool types displayed per page
        :type limit: int
        :param offset: Current offset of tool elements
        :type offset: int
        :param orphanedonly: Orphaned tool types only
        :type orphanedonly: bool
        :param toolproxyid: Tool proxy id
        :type toolproxyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_types_and_proxies_serialize(
            limit=limit,
            offset=offset,
            orphanedonly=orphanedonly,
            toolproxyid=toolproxyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolTypesAndProxiesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lti_get_tool_types_and_proxies(
        self,
        limit: Annotated[Optional[StrictInt], Field(description="How many tool types displayed per page")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Current offset of tool elements")] = None,
        orphanedonly: Annotated[Optional[StrictBool], Field(description="Orphaned tool types only")] = None,
        toolproxyid: Annotated[Optional[StrictInt], Field(description="Tool proxy id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLtiGetToolTypesAndProxiesResponse:
        """Get a list of the tool types and tool proxies

        Get a list of the tool types and tool proxies

        :param limit: How many tool types displayed per page
        :type limit: int
        :param offset: Current offset of tool elements
        :type offset: int
        :param orphanedonly: Orphaned tool types only
        :type orphanedonly: bool
        :param toolproxyid: Tool proxy id
        :type toolproxyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_types_and_proxies_serialize(
            limit=limit,
            offset=offset,
            orphanedonly=orphanedonly,
            toolproxyid=toolproxyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolTypesAndProxiesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_get_tool_types_and_proxies_from_args(
        self,
        args
    ) -> ModLtiGetToolTypesAndProxiesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolTypesAndProxiesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_get_tool_types_and_proxies_with_http_info(
        self,
        limit: Annotated[Optional[StrictInt], Field(description="How many tool types displayed per page")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Current offset of tool elements")] = None,
        orphanedonly: Annotated[Optional[StrictBool], Field(description="Orphaned tool types only")] = None,
        toolproxyid: Annotated[Optional[StrictInt], Field(description="Tool proxy id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLtiGetToolTypesAndProxiesResponse]:
        """Get a list of the tool types and tool proxies

        Get a list of the tool types and tool proxies

        :param limit: How many tool types displayed per page
        :type limit: int
        :param offset: Current offset of tool elements
        :type offset: int
        :param orphanedonly: Orphaned tool types only
        :type orphanedonly: bool
        :param toolproxyid: Tool proxy id
        :type toolproxyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_types_and_proxies_serialize(
            limit=limit,
            offset=offset,
            orphanedonly=orphanedonly,
            toolproxyid=toolproxyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolTypesAndProxiesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lti_get_tool_types_and_proxies_without_preload_content(
        self,
        limit: Annotated[Optional[StrictInt], Field(description="How many tool types displayed per page")] = None,
        offset: Annotated[Optional[StrictInt], Field(description="Current offset of tool elements")] = None,
        orphanedonly: Annotated[Optional[StrictBool], Field(description="Orphaned tool types only")] = None,
        toolproxyid: Annotated[Optional[StrictInt], Field(description="Tool proxy id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get a list of the tool types and tool proxies

        Get a list of the tool types and tool proxies

        :param limit: How many tool types displayed per page
        :type limit: int
        :param offset: Current offset of tool elements
        :type offset: int
        :param orphanedonly: Orphaned tool types only
        :type orphanedonly: bool
        :param toolproxyid: Tool proxy id
        :type toolproxyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_types_and_proxies_serialize(
            limit=limit,
            offset=offset,
            orphanedonly=orphanedonly,
            toolproxyid=toolproxyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolTypesAndProxiesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lti_get_tool_types_and_proxies_serialize(
        self,
        limit,
        offset,
        orphanedonly,
        toolproxyid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lti_get_tool_types_and_proxies'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lti_get_tool_types_and_proxies'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lti_get_tool_types_and_proxies',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if limit is not None:
            _form_params += parse_form({'limit': limit})
        if offset is not None:
            _form_params += parse_form({'offset': offset})
        if orphanedonly is not None:
            _form_params += parse_form({'orphanedonly': orphanedonly})
        if toolproxyid is not None:
            _form_params += parse_form({'toolproxyid': toolproxyid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lti_get_tool_types_and_proxies_count_args(
        self,
        orphanedonly: Annotated[Optional[StrictBool], Field(description="Orphaned tool types only")] = None,
        toolproxyid: Annotated[Optional[StrictInt], Field(description="Tool proxy id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get total number of the tool types and tool proxies

        Get total number of the tool types and tool proxies

        :param orphanedonly: Orphaned tool types only
        :type orphanedonly: bool
        :param toolproxyid: Tool proxy id
        :type toolproxyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_types_and_proxies_count_serialize(
            orphanedonly=orphanedonly,
            toolproxyid=toolproxyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolTypesAndProxiesCountResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lti_get_tool_types_and_proxies_count(
        self,
        orphanedonly: Annotated[Optional[StrictBool], Field(description="Orphaned tool types only")] = None,
        toolproxyid: Annotated[Optional[StrictInt], Field(description="Tool proxy id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLtiGetToolTypesAndProxiesCountResponse:
        """Get total number of the tool types and tool proxies

        Get total number of the tool types and tool proxies

        :param orphanedonly: Orphaned tool types only
        :type orphanedonly: bool
        :param toolproxyid: Tool proxy id
        :type toolproxyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_types_and_proxies_count_serialize(
            orphanedonly=orphanedonly,
            toolproxyid=toolproxyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolTypesAndProxiesCountResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_get_tool_types_and_proxies_count_from_args(
        self,
        args
    ) -> ModLtiGetToolTypesAndProxiesCountResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolTypesAndProxiesCountResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_get_tool_types_and_proxies_count_with_http_info(
        self,
        orphanedonly: Annotated[Optional[StrictBool], Field(description="Orphaned tool types only")] = None,
        toolproxyid: Annotated[Optional[StrictInt], Field(description="Tool proxy id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLtiGetToolTypesAndProxiesCountResponse]:
        """Get total number of the tool types and tool proxies

        Get total number of the tool types and tool proxies

        :param orphanedonly: Orphaned tool types only
        :type orphanedonly: bool
        :param toolproxyid: Tool proxy id
        :type toolproxyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_types_and_proxies_count_serialize(
            orphanedonly=orphanedonly,
            toolproxyid=toolproxyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolTypesAndProxiesCountResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lti_get_tool_types_and_proxies_count_without_preload_content(
        self,
        orphanedonly: Annotated[Optional[StrictBool], Field(description="Orphaned tool types only")] = None,
        toolproxyid: Annotated[Optional[StrictInt], Field(description="Tool proxy id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get total number of the tool types and tool proxies

        Get total number of the tool types and tool proxies

        :param orphanedonly: Orphaned tool types only
        :type orphanedonly: bool
        :param toolproxyid: Tool proxy id
        :type toolproxyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_get_tool_types_and_proxies_count_serialize(
            orphanedonly=orphanedonly,
            toolproxyid=toolproxyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiGetToolTypesAndProxiesCountResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lti_get_tool_types_and_proxies_count_serialize(
        self,
        orphanedonly,
        toolproxyid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lti_get_tool_types_and_proxies_count'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lti_get_tool_types_and_proxies_count'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lti_get_tool_types_and_proxies_count',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if orphanedonly is not None:
            _form_params += parse_form({'orphanedonly': orphanedonly})
        if toolproxyid is not None:
            _form_params += parse_form({'toolproxyid': toolproxyid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lti_is_cartridge_args(
        self,
        url: Annotated[Optional[StrictStr], Field(description="Tool url")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Determine if the given url is for a cartridge

        Determine if the given url is for a cartridge

        :param url: Tool url (required)
        :type url: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_is_cartridge_serialize(
            url=url,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiIsCartridgeResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lti_is_cartridge(
        self,
        url: Annotated[Optional[StrictStr], Field(description="Tool url")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLtiIsCartridgeResponse:
        """Determine if the given url is for a cartridge

        Determine if the given url is for a cartridge

        :param url: Tool url (required)
        :type url: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_is_cartridge_serialize(
            url=url,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiIsCartridgeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_is_cartridge_from_args(
        self,
        args
    ) -> ModLtiIsCartridgeResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiIsCartridgeResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_is_cartridge_with_http_info(
        self,
        url: Annotated[Optional[StrictStr], Field(description="Tool url")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLtiIsCartridgeResponse]:
        """Determine if the given url is for a cartridge

        Determine if the given url is for a cartridge

        :param url: Tool url (required)
        :type url: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_is_cartridge_serialize(
            url=url,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiIsCartridgeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lti_is_cartridge_without_preload_content(
        self,
        url: Annotated[Optional[StrictStr], Field(description="Tool url")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Determine if the given url is for a cartridge

        Determine if the given url is for a cartridge

        :param url: Tool url (required)
        :type url: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_is_cartridge_serialize(
            url=url,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiIsCartridgeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lti_is_cartridge_serialize(
        self,
        url,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lti_is_cartridge'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lti_is_cartridge'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lti_is_cartridge',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if url is not None:
            _form_params += parse_form({'url': url})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lti_toggle_showinactivitychooser_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        showinactivitychooser: Annotated[Optional[StrictBool], Field(description="Show in activity chooser")],
        tooltypeid: Annotated[Optional[StrictInt], Field(description="Tool type ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Toggle showinactivitychooser for a tool type in a course

        Toggle showinactivitychooser for a tool type in a course

        :param courseid: Course ID (required)
        :type courseid: int
        :param showinactivitychooser: Show in activity chooser (required)
        :type showinactivitychooser: bool
        :param tooltypeid: Tool type ID (required)
        :type tooltypeid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_toggle_showinactivitychooser_serialize(
            courseid=courseid,
            showinactivitychooser=showinactivitychooser,
            tooltypeid=tooltypeid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lti_toggle_showinactivitychooser(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        showinactivitychooser: Annotated[Optional[StrictBool], Field(description="Show in activity chooser")],
        tooltypeid: Annotated[Optional[StrictInt], Field(description="Tool type ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Toggle showinactivitychooser for a tool type in a course

        Toggle showinactivitychooser for a tool type in a course

        :param courseid: Course ID (required)
        :type courseid: int
        :param showinactivitychooser: Show in activity chooser (required)
        :type showinactivitychooser: bool
        :param tooltypeid: Tool type ID (required)
        :type tooltypeid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_toggle_showinactivitychooser_serialize(
            courseid=courseid,
            showinactivitychooser=showinactivitychooser,
            tooltypeid=tooltypeid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_toggle_showinactivitychooser_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_toggle_showinactivitychooser_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        showinactivitychooser: Annotated[Optional[StrictBool], Field(description="Show in activity chooser")],
        tooltypeid: Annotated[Optional[StrictInt], Field(description="Tool type ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Toggle showinactivitychooser for a tool type in a course

        Toggle showinactivitychooser for a tool type in a course

        :param courseid: Course ID (required)
        :type courseid: int
        :param showinactivitychooser: Show in activity chooser (required)
        :type showinactivitychooser: bool
        :param tooltypeid: Tool type ID (required)
        :type tooltypeid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_toggle_showinactivitychooser_serialize(
            courseid=courseid,
            showinactivitychooser=showinactivitychooser,
            tooltypeid=tooltypeid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lti_toggle_showinactivitychooser_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="Course ID")],
        showinactivitychooser: Annotated[Optional[StrictBool], Field(description="Show in activity chooser")],
        tooltypeid: Annotated[Optional[StrictInt], Field(description="Tool type ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Toggle showinactivitychooser for a tool type in a course

        Toggle showinactivitychooser for a tool type in a course

        :param courseid: Course ID (required)
        :type courseid: int
        :param showinactivitychooser: Show in activity chooser (required)
        :type showinactivitychooser: bool
        :param tooltypeid: Tool type ID (required)
        :type tooltypeid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_toggle_showinactivitychooser_serialize(
            courseid=courseid,
            showinactivitychooser=showinactivitychooser,
            tooltypeid=tooltypeid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lti_toggle_showinactivitychooser_serialize(
        self,
        courseid,
        showinactivitychooser,
        tooltypeid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lti_toggle_showinactivitychooser'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lti_toggle_showinactivitychooser'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lti_toggle_showinactivitychooser',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if showinactivitychooser is not None:
            _form_params += parse_form({'showinactivitychooser': showinactivitychooser})
        if tooltypeid is not None:
            _form_params += parse_form({'tooltypeid': tooltypeid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lti_update_tool_type_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Tool type id")],
        description: Annotated[Optional[StrictStr], Field(description="Tool type description")] = None,
        name: Annotated[Optional[StrictStr], Field(description="Tool type name")] = None,
        state: Annotated[Optional[StrictInt], Field(description="Tool type state")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update a tool type

        Update a tool type

        :param id: Tool type id (required)
        :type id: int
        :param description: Tool type description
        :type description: str
        :param name: Tool type name
        :type name: str
        :param state: Tool type state
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_update_tool_type_serialize(
            id=id,
            description=description,
            name=name,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiUpdateToolTypeResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lti_update_tool_type(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Tool type id")],
        description: Annotated[Optional[StrictStr], Field(description="Tool type description")] = None,
        name: Annotated[Optional[StrictStr], Field(description="Tool type name")] = None,
        state: Annotated[Optional[StrictInt], Field(description="Tool type state")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLtiUpdateToolTypeResponse:
        """Update a tool type

        Update a tool type

        :param id: Tool type id (required)
        :type id: int
        :param description: Tool type description
        :type description: str
        :param name: Tool type name
        :type name: str
        :param state: Tool type state
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_update_tool_type_serialize(
            id=id,
            description=description,
            name=name,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiUpdateToolTypeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_update_tool_type_from_args(
        self,
        args
    ) -> ModLtiUpdateToolTypeResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiUpdateToolTypeResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_update_tool_type_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Tool type id")],
        description: Annotated[Optional[StrictStr], Field(description="Tool type description")] = None,
        name: Annotated[Optional[StrictStr], Field(description="Tool type name")] = None,
        state: Annotated[Optional[StrictInt], Field(description="Tool type state")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLtiUpdateToolTypeResponse]:
        """Update a tool type

        Update a tool type

        :param id: Tool type id (required)
        :type id: int
        :param description: Tool type description
        :type description: str
        :param name: Tool type name
        :type name: str
        :param state: Tool type state
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_update_tool_type_serialize(
            id=id,
            description=description,
            name=name,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiUpdateToolTypeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lti_update_tool_type_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="Tool type id")],
        description: Annotated[Optional[StrictStr], Field(description="Tool type description")] = None,
        name: Annotated[Optional[StrictStr], Field(description="Tool type name")] = None,
        state: Annotated[Optional[StrictInt], Field(description="Tool type state")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update a tool type

        Update a tool type

        :param id: Tool type id (required)
        :type id: int
        :param description: Tool type description
        :type description: str
        :param name: Tool type name
        :type name: str
        :param state: Tool type state
        :type state: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_update_tool_type_serialize(
            id=id,
            description=description,
            name=name,
            state=state,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiUpdateToolTypeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lti_update_tool_type_serialize(
        self,
        id,
        description,
        name,
        state,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lti_update_tool_type'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lti_update_tool_type'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lti_update_tool_type',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if description is not None:
            _form_params += parse_form({'description': description})
        if id is not None:
            _form_params += parse_form({'id': id})
        if name is not None:
            _form_params += parse_form({'name': name})
        if state is not None:
            _form_params += parse_form({'state': state})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_lti_view_lti_args(
        self,
        ltiid: Annotated[Optional[StrictInt], Field(description="lti instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param ltiid: lti instance id (required)
        :type ltiid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_view_lti_serialize(
            ltiid=ltiid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiViewLtiResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_lti_view_lti(
        self,
        ltiid: Annotated[Optional[StrictInt], Field(description="lti instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModLtiViewLtiResponse:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param ltiid: lti instance id (required)
        :type ltiid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_view_lti_serialize(
            ltiid=ltiid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiViewLtiResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_view_lti_from_args(
        self,
        args
    ) -> ModLtiViewLtiResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiViewLtiResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_lti_view_lti_with_http_info(
        self,
        ltiid: Annotated[Optional[StrictInt], Field(description="lti instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModLtiViewLtiResponse]:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param ltiid: lti instance id (required)
        :type ltiid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_view_lti_serialize(
            ltiid=ltiid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiViewLtiResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_lti_view_lti_without_preload_content(
        self,
        ltiid: Annotated[Optional[StrictInt], Field(description="lti instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param ltiid: lti instance id (required)
        :type ltiid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_lti_view_lti_serialize(
            ltiid=ltiid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModLtiViewLtiResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_lti_view_lti_serialize(
        self,
        ltiid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_lti_view_lti'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_lti_view_lti'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_lti_view_lti',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if ltiid is not None:
            _form_params += parse_form({'ltiid': ltiid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_page_get_pages_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of pages in a provided list of courses, if no list is provided all pages that the user                             can view will be returned.

        Returns a list of pages in a provided list of courses, if no list is provided all pages that the user                             can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_page_get_pages_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModPageGetPagesByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_page_get_pages_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModPageGetPagesByCoursesResponse:
        """Returns a list of pages in a provided list of courses, if no list is provided all pages that the user                             can view will be returned.

        Returns a list of pages in a provided list of courses, if no list is provided all pages that the user                             can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_page_get_pages_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModPageGetPagesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_page_get_pages_by_courses_from_args(
        self,
        args
    ) -> ModPageGetPagesByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModPageGetPagesByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_page_get_pages_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModPageGetPagesByCoursesResponse]:
        """Returns a list of pages in a provided list of courses, if no list is provided all pages that the user                             can view will be returned.

        Returns a list of pages in a provided list of courses, if no list is provided all pages that the user                             can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_page_get_pages_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModPageGetPagesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_page_get_pages_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of pages in a provided list of courses, if no list is provided all pages that the user                             can view will be returned.

        Returns a list of pages in a provided list of courses, if no list is provided all pages that the user                             can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_page_get_pages_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModPageGetPagesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_page_get_pages_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_page_get_pages_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_page_get_pages_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_page_get_pages_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_page_view_page_args(
        self,
        pageid: Annotated[Optional[StrictInt], Field(description="page instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Simulate the view.php web interface page: trigger events, completion, etc...

        Simulate the view.php web interface page: trigger events, completion, etc...

        :param pageid: page instance id (required)
        :type pageid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_page_view_page_serialize(
            pageid=pageid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModPageViewPageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_page_view_page(
        self,
        pageid: Annotated[Optional[StrictInt], Field(description="page instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModPageViewPageResponse:
        """Simulate the view.php web interface page: trigger events, completion, etc...

        Simulate the view.php web interface page: trigger events, completion, etc...

        :param pageid: page instance id (required)
        :type pageid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_page_view_page_serialize(
            pageid=pageid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModPageViewPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_page_view_page_from_args(
        self,
        args
    ) -> ModPageViewPageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModPageViewPageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_page_view_page_with_http_info(
        self,
        pageid: Annotated[Optional[StrictInt], Field(description="page instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModPageViewPageResponse]:
        """Simulate the view.php web interface page: trigger events, completion, etc...

        Simulate the view.php web interface page: trigger events, completion, etc...

        :param pageid: page instance id (required)
        :type pageid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_page_view_page_serialize(
            pageid=pageid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModPageViewPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_page_view_page_without_preload_content(
        self,
        pageid: Annotated[Optional[StrictInt], Field(description="page instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Simulate the view.php web interface page: trigger events, completion, etc...

        Simulate the view.php web interface page: trigger events, completion, etc...

        :param pageid: page instance id (required)
        :type pageid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_page_view_page_serialize(
            pageid=pageid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModPageViewPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_page_view_page_serialize(
        self,
        pageid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_page_view_page'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_page_view_page'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_page_view_page',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if pageid is not None:
            _form_params += parse_form({'pageid': pageid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_add_random_questions_args(
        self,
        addonpage: Annotated[Optional[StrictInt], Field(description="The page where random questions will be added to")],
        cmid: Annotated[Optional[StrictInt], Field(description="The cmid of the quiz")],
        randomcount: Annotated[Optional[StrictInt], Field(description="Number of random questions")],
        filtercondition: Annotated[Optional[StrictStr], Field(description="(Optional) The filter condition used when adding random questions from an existing category.                     Not required if adding random questions from a new category.")] = None,
        newcategory: Annotated[Optional[StrictStr], Field(description="(Optional) The name of a new question category to create and use for the random questions.")] = None,
        parentcategory: Annotated[Optional[StrictStr], Field(description="(Optional) The parent of the new question category, if creating one.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Add a number of random questions to a quiz.

        Add a number of random questions to a quiz.

        :param addonpage: The page where random questions will be added to (required)
        :type addonpage: int
        :param cmid: The cmid of the quiz (required)
        :type cmid: int
        :param randomcount: Number of random questions (required)
        :type randomcount: int
        :param filtercondition: (Optional) The filter condition used when adding random questions from an existing category.                     Not required if adding random questions from a new category.
        :type filtercondition: str
        :param newcategory: (Optional) The name of a new question category to create and use for the random questions.
        :type newcategory: str
        :param parentcategory: (Optional) The parent of the new question category, if creating one.
        :type parentcategory: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_add_random_questions_serialize(
            addonpage=addonpage,
            cmid=cmid,
            randomcount=randomcount,
            filtercondition=filtercondition,
            newcategory=newcategory,
            parentcategory=parentcategory,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizAddRandomQuestionsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_add_random_questions(
        self,
        addonpage: Annotated[Optional[StrictInt], Field(description="The page where random questions will be added to")],
        cmid: Annotated[Optional[StrictInt], Field(description="The cmid of the quiz")],
        randomcount: Annotated[Optional[StrictInt], Field(description="Number of random questions")],
        filtercondition: Annotated[Optional[StrictStr], Field(description="(Optional) The filter condition used when adding random questions from an existing category.                     Not required if adding random questions from a new category.")] = None,
        newcategory: Annotated[Optional[StrictStr], Field(description="(Optional) The name of a new question category to create and use for the random questions.")] = None,
        parentcategory: Annotated[Optional[StrictStr], Field(description="(Optional) The parent of the new question category, if creating one.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizAddRandomQuestionsResponse:
        """Add a number of random questions to a quiz.

        Add a number of random questions to a quiz.

        :param addonpage: The page where random questions will be added to (required)
        :type addonpage: int
        :param cmid: The cmid of the quiz (required)
        :type cmid: int
        :param randomcount: Number of random questions (required)
        :type randomcount: int
        :param filtercondition: (Optional) The filter condition used when adding random questions from an existing category.                     Not required if adding random questions from a new category.
        :type filtercondition: str
        :param newcategory: (Optional) The name of a new question category to create and use for the random questions.
        :type newcategory: str
        :param parentcategory: (Optional) The parent of the new question category, if creating one.
        :type parentcategory: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_add_random_questions_serialize(
            addonpage=addonpage,
            cmid=cmid,
            randomcount=randomcount,
            filtercondition=filtercondition,
            newcategory=newcategory,
            parentcategory=parentcategory,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizAddRandomQuestionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_add_random_questions_from_args(
        self,
        args
    ) -> ModQuizAddRandomQuestionsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizAddRandomQuestionsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_add_random_questions_with_http_info(
        self,
        addonpage: Annotated[Optional[StrictInt], Field(description="The page where random questions will be added to")],
        cmid: Annotated[Optional[StrictInt], Field(description="The cmid of the quiz")],
        randomcount: Annotated[Optional[StrictInt], Field(description="Number of random questions")],
        filtercondition: Annotated[Optional[StrictStr], Field(description="(Optional) The filter condition used when adding random questions from an existing category.                     Not required if adding random questions from a new category.")] = None,
        newcategory: Annotated[Optional[StrictStr], Field(description="(Optional) The name of a new question category to create and use for the random questions.")] = None,
        parentcategory: Annotated[Optional[StrictStr], Field(description="(Optional) The parent of the new question category, if creating one.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizAddRandomQuestionsResponse]:
        """Add a number of random questions to a quiz.

        Add a number of random questions to a quiz.

        :param addonpage: The page where random questions will be added to (required)
        :type addonpage: int
        :param cmid: The cmid of the quiz (required)
        :type cmid: int
        :param randomcount: Number of random questions (required)
        :type randomcount: int
        :param filtercondition: (Optional) The filter condition used when adding random questions from an existing category.                     Not required if adding random questions from a new category.
        :type filtercondition: str
        :param newcategory: (Optional) The name of a new question category to create and use for the random questions.
        :type newcategory: str
        :param parentcategory: (Optional) The parent of the new question category, if creating one.
        :type parentcategory: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_add_random_questions_serialize(
            addonpage=addonpage,
            cmid=cmid,
            randomcount=randomcount,
            filtercondition=filtercondition,
            newcategory=newcategory,
            parentcategory=parentcategory,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizAddRandomQuestionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_add_random_questions_without_preload_content(
        self,
        addonpage: Annotated[Optional[StrictInt], Field(description="The page where random questions will be added to")],
        cmid: Annotated[Optional[StrictInt], Field(description="The cmid of the quiz")],
        randomcount: Annotated[Optional[StrictInt], Field(description="Number of random questions")],
        filtercondition: Annotated[Optional[StrictStr], Field(description="(Optional) The filter condition used when adding random questions from an existing category.                     Not required if adding random questions from a new category.")] = None,
        newcategory: Annotated[Optional[StrictStr], Field(description="(Optional) The name of a new question category to create and use for the random questions.")] = None,
        parentcategory: Annotated[Optional[StrictStr], Field(description="(Optional) The parent of the new question category, if creating one.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Add a number of random questions to a quiz.

        Add a number of random questions to a quiz.

        :param addonpage: The page where random questions will be added to (required)
        :type addonpage: int
        :param cmid: The cmid of the quiz (required)
        :type cmid: int
        :param randomcount: Number of random questions (required)
        :type randomcount: int
        :param filtercondition: (Optional) The filter condition used when adding random questions from an existing category.                     Not required if adding random questions from a new category.
        :type filtercondition: str
        :param newcategory: (Optional) The name of a new question category to create and use for the random questions.
        :type newcategory: str
        :param parentcategory: (Optional) The parent of the new question category, if creating one.
        :type parentcategory: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_add_random_questions_serialize(
            addonpage=addonpage,
            cmid=cmid,
            randomcount=randomcount,
            filtercondition=filtercondition,
            newcategory=newcategory,
            parentcategory=parentcategory,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizAddRandomQuestionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_add_random_questions_serialize(
        self,
        addonpage,
        cmid,
        randomcount,
        filtercondition,
        newcategory,
        parentcategory,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_add_random_questions'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_add_random_questions'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_add_random_questions',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if addonpage is not None:
            _form_params += parse_form({'addonpage': addonpage})
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        if filtercondition is not None:
            _form_params += parse_form({'filtercondition': filtercondition})
        if newcategory is not None:
            _form_params += parse_form({'newcategory': newcategory})
        if parentcategory is not None:
            _form_params += parse_form({'parentcategory': parentcategory})
        if randomcount is not None:
            _form_params += parse_form({'randomcount': randomcount})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_create_grade_item_per_section_args(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """For a quiz with no grade items yet, create a grade item for each section, with the questions in that section assigned.

        For a quiz with no grade items yet, create a grade item for each section, with the questions in that section assigned.

        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_create_grade_item_per_section_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_create_grade_item_per_section(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """For a quiz with no grade items yet, create a grade item for each section, with the questions in that section assigned.

        For a quiz with no grade items yet, create a grade item for each section, with the questions in that section assigned.

        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_create_grade_item_per_section_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_create_grade_item_per_section_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_create_grade_item_per_section_with_http_info(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """For a quiz with no grade items yet, create a grade item for each section, with the questions in that section assigned.

        For a quiz with no grade items yet, create a grade item for each section, with the questions in that section assigned.

        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_create_grade_item_per_section_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_create_grade_item_per_section_without_preload_content(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """For a quiz with no grade items yet, create a grade item for each section, with the questions in that section assigned.

        For a quiz with no grade items yet, create a grade item for each section, with the questions in that section assigned.

        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_create_grade_item_per_section_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_create_grade_item_per_section_serialize(
        self,
        quizid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_create_grade_item_per_section'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_create_grade_item_per_section'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_create_grade_item_per_section',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_create_grade_items_args(
        self,
        quizgradeitems: List[ModQuizCreateGradeItemsParametersQuizgradeitemsInner],
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Create quiz grade items. All grade items must belong to the same quiz.

        Create quiz grade items. All grade items must belong to the same quiz.

        :param quizgradeitems: (required)
        :type quizgradeitems: List[ModQuizCreateGradeItemsParametersQuizgradeitemsInner]
        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_create_grade_items_serialize(
            quizgradeitems=quizgradeitems,
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_create_grade_items(
        self,
        quizgradeitems: List[ModQuizCreateGradeItemsParametersQuizgradeitemsInner],
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Create quiz grade items. All grade items must belong to the same quiz.

        Create quiz grade items. All grade items must belong to the same quiz.

        :param quizgradeitems: (required)
        :type quizgradeitems: List[ModQuizCreateGradeItemsParametersQuizgradeitemsInner]
        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_create_grade_items_serialize(
            quizgradeitems=quizgradeitems,
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_create_grade_items_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_create_grade_items_with_http_info(
        self,
        quizgradeitems: List[ModQuizCreateGradeItemsParametersQuizgradeitemsInner],
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Create quiz grade items. All grade items must belong to the same quiz.

        Create quiz grade items. All grade items must belong to the same quiz.

        :param quizgradeitems: (required)
        :type quizgradeitems: List[ModQuizCreateGradeItemsParametersQuizgradeitemsInner]
        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_create_grade_items_serialize(
            quizgradeitems=quizgradeitems,
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_create_grade_items_without_preload_content(
        self,
        quizgradeitems: List[ModQuizCreateGradeItemsParametersQuizgradeitemsInner],
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create quiz grade items. All grade items must belong to the same quiz.

        Create quiz grade items. All grade items must belong to the same quiz.

        :param quizgradeitems: (required)
        :type quizgradeitems: List[ModQuizCreateGradeItemsParametersQuizgradeitemsInner]
        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_create_grade_items_serialize(
            quizgradeitems=quizgradeitems,
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_create_grade_items_serialize(
        self,
        quizgradeitems,
        quizid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'quizgradeitems': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_create_grade_items'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_create_grade_items'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_create_grade_items',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if quizgradeitems is not None:
            _form_params += parse_form({'quizgradeitems': quizgradeitems})
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_delete_grade_items_args(
        self,
        quizgradeitems: List[ModQuizDeleteGradeItemsParametersQuizgradeitemsInner],
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete quiz grade items. All grade items must belong to the same quiz.

        Delete quiz grade items. All grade items must belong to the same quiz.

        :param quizgradeitems: (required)
        :type quizgradeitems: List[ModQuizDeleteGradeItemsParametersQuizgradeitemsInner]
        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_delete_grade_items_serialize(
            quizgradeitems=quizgradeitems,
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_delete_grade_items(
        self,
        quizgradeitems: List[ModQuizDeleteGradeItemsParametersQuizgradeitemsInner],
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Delete quiz grade items. All grade items must belong to the same quiz.

        Delete quiz grade items. All grade items must belong to the same quiz.

        :param quizgradeitems: (required)
        :type quizgradeitems: List[ModQuizDeleteGradeItemsParametersQuizgradeitemsInner]
        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_delete_grade_items_serialize(
            quizgradeitems=quizgradeitems,
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_delete_grade_items_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_delete_grade_items_with_http_info(
        self,
        quizgradeitems: List[ModQuizDeleteGradeItemsParametersQuizgradeitemsInner],
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Delete quiz grade items. All grade items must belong to the same quiz.

        Delete quiz grade items. All grade items must belong to the same quiz.

        :param quizgradeitems: (required)
        :type quizgradeitems: List[ModQuizDeleteGradeItemsParametersQuizgradeitemsInner]
        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_delete_grade_items_serialize(
            quizgradeitems=quizgradeitems,
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_delete_grade_items_without_preload_content(
        self,
        quizgradeitems: List[ModQuizDeleteGradeItemsParametersQuizgradeitemsInner],
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete quiz grade items. All grade items must belong to the same quiz.

        Delete quiz grade items. All grade items must belong to the same quiz.

        :param quizgradeitems: (required)
        :type quizgradeitems: List[ModQuizDeleteGradeItemsParametersQuizgradeitemsInner]
        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_delete_grade_items_serialize(
            quizgradeitems=quizgradeitems,
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_delete_grade_items_serialize(
        self,
        quizgradeitems,
        quizid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'quizgradeitems': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_delete_grade_items'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_delete_grade_items'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_delete_grade_items',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if quizgradeitems is not None:
            _form_params += parse_form({'quizgradeitems': quizgradeitems})
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_delete_overrides_args(
        self,
        data: ModQuizDeleteOverridesParametersData,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete quiz overrides

        Delete quiz overrides

        :param data: (required)
        :type data: ModQuizDeleteOverridesParametersData
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_delete_overrides_serialize(
            data=data,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizDeleteOverridesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_delete_overrides(
        self,
        data: ModQuizDeleteOverridesParametersData,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizDeleteOverridesResponse:
        """Delete quiz overrides

        Delete quiz overrides

        :param data: (required)
        :type data: ModQuizDeleteOverridesParametersData
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_delete_overrides_serialize(
            data=data,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizDeleteOverridesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_delete_overrides_from_args(
        self,
        args
    ) -> ModQuizDeleteOverridesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizDeleteOverridesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_delete_overrides_with_http_info(
        self,
        data: ModQuizDeleteOverridesParametersData,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizDeleteOverridesResponse]:
        """Delete quiz overrides

        Delete quiz overrides

        :param data: (required)
        :type data: ModQuizDeleteOverridesParametersData
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_delete_overrides_serialize(
            data=data,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizDeleteOverridesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_delete_overrides_without_preload_content(
        self,
        data: ModQuizDeleteOverridesParametersData,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete quiz overrides

        Delete quiz overrides

        :param data: (required)
        :type data: ModQuizDeleteOverridesParametersData
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_delete_overrides_serialize(
            data=data,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizDeleteOverridesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_delete_overrides_serialize(
        self,
        data,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_delete_overrides'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_delete_overrides'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_delete_overrides',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if data is not None:
            _form_params += parse_form({'data': data})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_get_attempt_access_information_args(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id, 0 for the user last attempt if exists")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return access information for a given attempt in a quiz.

        Return access information for a given attempt in a quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param attemptid: attempt id, 0 for the user last attempt if exists
        :type attemptid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_attempt_access_information_serialize(
            quizid=quizid,
            attemptid=attemptid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptAccessInformationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_get_attempt_access_information(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id, 0 for the user last attempt if exists")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizGetAttemptAccessInformationResponse:
        """Return access information for a given attempt in a quiz.

        Return access information for a given attempt in a quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param attemptid: attempt id, 0 for the user last attempt if exists
        :type attemptid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_attempt_access_information_serialize(
            quizid=quizid,
            attemptid=attemptid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_attempt_access_information_from_args(
        self,
        args
    ) -> ModQuizGetAttemptAccessInformationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptAccessInformationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_attempt_access_information_with_http_info(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id, 0 for the user last attempt if exists")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizGetAttemptAccessInformationResponse]:
        """Return access information for a given attempt in a quiz.

        Return access information for a given attempt in a quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param attemptid: attempt id, 0 for the user last attempt if exists
        :type attemptid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_attempt_access_information_serialize(
            quizid=quizid,
            attemptid=attemptid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_get_attempt_access_information_without_preload_content(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id, 0 for the user last attempt if exists")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return access information for a given attempt in a quiz.

        Return access information for a given attempt in a quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param attemptid: attempt id, 0 for the user last attempt if exists
        :type attemptid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_attempt_access_information_serialize(
            quizid=quizid,
            attemptid=attemptid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_get_attempt_access_information_serialize(
        self,
        quizid,
        attemptid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_get_attempt_access_information'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_get_attempt_access_information'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_get_attempt_access_information',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attemptid is not None:
            _form_params += parse_form({'attemptid': attemptid})
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_get_attempt_data_args(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        page: Annotated[Optional[StrictInt], Field(description="page number")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns information for the given attempt page for a quiz attempt in progress.

        Returns information for the given attempt page for a quiz attempt in progress.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param page: page number (required)
        :type page: int
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_attempt_data_serialize(
            attemptid=attemptid,
            page=page,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptDataResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_get_attempt_data(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        page: Annotated[Optional[StrictInt], Field(description="page number")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizGetAttemptDataResponse:
        """Returns information for the given attempt page for a quiz attempt in progress.

        Returns information for the given attempt page for a quiz attempt in progress.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param page: page number (required)
        :type page: int
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_attempt_data_serialize(
            attemptid=attemptid,
            page=page,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptDataResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_attempt_data_from_args(
        self,
        args
    ) -> ModQuizGetAttemptDataResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptDataResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_attempt_data_with_http_info(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        page: Annotated[Optional[StrictInt], Field(description="page number")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizGetAttemptDataResponse]:
        """Returns information for the given attempt page for a quiz attempt in progress.

        Returns information for the given attempt page for a quiz attempt in progress.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param page: page number (required)
        :type page: int
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_attempt_data_serialize(
            attemptid=attemptid,
            page=page,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptDataResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_get_attempt_data_without_preload_content(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        page: Annotated[Optional[StrictInt], Field(description="page number")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns information for the given attempt page for a quiz attempt in progress.

        Returns information for the given attempt page for a quiz attempt in progress.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param page: page number (required)
        :type page: int
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_attempt_data_serialize(
            attemptid=attemptid,
            page=page,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptDataResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_get_attempt_data_serialize(
        self,
        attemptid,
        page,
        preflightdata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'preflightdata': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_get_attempt_data'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_get_attempt_data'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_get_attempt_data',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attemptid is not None:
            _form_params += parse_form({'attemptid': attemptid})
        if page is not None:
            _form_params += parse_form({'page': page})
        if preflightdata is not None:
            _form_params += parse_form({'preflightdata': preflightdata})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_get_attempt_review_args(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        page: Annotated[Optional[StrictInt], Field(description="page number, empty for all the questions in all the pages")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns review information for the given finished attempt, can be used by users or teachers.

        Returns review information for the given finished attempt, can be used by users or teachers.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param page: page number, empty for all the questions in all the pages
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_attempt_review_serialize(
            attemptid=attemptid,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptReviewResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_get_attempt_review(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        page: Annotated[Optional[StrictInt], Field(description="page number, empty for all the questions in all the pages")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizGetAttemptReviewResponse:
        """Returns review information for the given finished attempt, can be used by users or teachers.

        Returns review information for the given finished attempt, can be used by users or teachers.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param page: page number, empty for all the questions in all the pages
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_attempt_review_serialize(
            attemptid=attemptid,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptReviewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_attempt_review_from_args(
        self,
        args
    ) -> ModQuizGetAttemptReviewResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptReviewResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_attempt_review_with_http_info(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        page: Annotated[Optional[StrictInt], Field(description="page number, empty for all the questions in all the pages")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizGetAttemptReviewResponse]:
        """Returns review information for the given finished attempt, can be used by users or teachers.

        Returns review information for the given finished attempt, can be used by users or teachers.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param page: page number, empty for all the questions in all the pages
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_attempt_review_serialize(
            attemptid=attemptid,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptReviewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_get_attempt_review_without_preload_content(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        page: Annotated[Optional[StrictInt], Field(description="page number, empty for all the questions in all the pages")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns review information for the given finished attempt, can be used by users or teachers.

        Returns review information for the given finished attempt, can be used by users or teachers.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param page: page number, empty for all the questions in all the pages
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_attempt_review_serialize(
            attemptid=attemptid,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptReviewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_get_attempt_review_serialize(
        self,
        attemptid,
        page,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_get_attempt_review'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_get_attempt_review'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_get_attempt_review',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attemptid is not None:
            _form_params += parse_form({'attemptid': attemptid})
        if page is not None:
            _form_params += parse_form({'page': page})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_get_attempt_summary_args(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a summary of a quiz attempt before it is submitted.

        Returns a summary of a quiz attempt before it is submitted.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_attempt_summary_serialize(
            attemptid=attemptid,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptSummaryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_get_attempt_summary(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizGetAttemptSummaryResponse:
        """Returns a summary of a quiz attempt before it is submitted.

        Returns a summary of a quiz attempt before it is submitted.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_attempt_summary_serialize(
            attemptid=attemptid,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptSummaryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_attempt_summary_from_args(
        self,
        args
    ) -> ModQuizGetAttemptSummaryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptSummaryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_attempt_summary_with_http_info(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizGetAttemptSummaryResponse]:
        """Returns a summary of a quiz attempt before it is submitted.

        Returns a summary of a quiz attempt before it is submitted.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_attempt_summary_serialize(
            attemptid=attemptid,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptSummaryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_get_attempt_summary_without_preload_content(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a summary of a quiz attempt before it is submitted.

        Returns a summary of a quiz attempt before it is submitted.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_attempt_summary_serialize(
            attemptid=attemptid,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetAttemptSummaryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_get_attempt_summary_serialize(
        self,
        attemptid,
        preflightdata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'preflightdata': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_get_attempt_summary'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_get_attempt_summary'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_get_attempt_summary',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attemptid is not None:
            _form_params += parse_form({'attemptid': attemptid})
        if preflightdata is not None:
            _form_params += parse_form({'preflightdata': preflightdata})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_get_combined_review_options_args(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Combines the review options from a number of different quiz attempts.

        Combines the review options from a number of different quiz attempts.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param userid: user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_combined_review_options_serialize(
            quizid=quizid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetCombinedReviewOptionsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_get_combined_review_options(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizGetCombinedReviewOptionsResponse:
        """Combines the review options from a number of different quiz attempts.

        Combines the review options from a number of different quiz attempts.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param userid: user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_combined_review_options_serialize(
            quizid=quizid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetCombinedReviewOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_combined_review_options_from_args(
        self,
        args
    ) -> ModQuizGetCombinedReviewOptionsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetCombinedReviewOptionsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_combined_review_options_with_http_info(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizGetCombinedReviewOptionsResponse]:
        """Combines the review options from a number of different quiz attempts.

        Combines the review options from a number of different quiz attempts.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param userid: user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_combined_review_options_serialize(
            quizid=quizid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetCombinedReviewOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_get_combined_review_options_without_preload_content(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="user id (empty for current user)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Combines the review options from a number of different quiz attempts.

        Combines the review options from a number of different quiz attempts.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param userid: user id (empty for current user)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_combined_review_options_serialize(
            quizid=quizid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetCombinedReviewOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_get_combined_review_options_serialize(
        self,
        quizid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_get_combined_review_options'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_get_combined_review_options'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_get_combined_review_options',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_get_edit_grading_page_data_args(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz for which to return the data.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the data required to re-render the Quiz grading setup page

        Get the data required to re-render the Quiz grading setup page

        :param quizid: The quiz for which to return the data. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_edit_grading_page_data_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_get_edit_grading_page_data(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz for which to return the data.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """Get the data required to re-render the Quiz grading setup page

        Get the data required to re-render the Quiz grading setup page

        :param quizid: The quiz for which to return the data. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_edit_grading_page_data_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_edit_grading_page_data_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_edit_grading_page_data_with_http_info(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz for which to return the data.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """Get the data required to re-render the Quiz grading setup page

        Get the data required to re-render the Quiz grading setup page

        :param quizid: The quiz for which to return the data. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_edit_grading_page_data_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_get_edit_grading_page_data_without_preload_content(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz for which to return the data.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the data required to re-render the Quiz grading setup page

        Get the data required to re-render the Quiz grading setup page

        :param quizid: The quiz for which to return the data. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_edit_grading_page_data_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_get_edit_grading_page_data_serialize(
        self,
        quizid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_get_edit_grading_page_data'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_get_edit_grading_page_data'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_get_edit_grading_page_data',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_get_overrides_args(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="ID of quiz to get overrides for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get quiz overrides

        Get quiz overrides

        :param quizid: ID of quiz to get overrides for (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_overrides_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetOverridesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_get_overrides(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="ID of quiz to get overrides for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizGetOverridesResponse:
        """Get quiz overrides

        Get quiz overrides

        :param quizid: ID of quiz to get overrides for (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_overrides_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetOverridesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_overrides_from_args(
        self,
        args
    ) -> ModQuizGetOverridesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetOverridesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_overrides_with_http_info(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="ID of quiz to get overrides for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizGetOverridesResponse]:
        """Get quiz overrides

        Get quiz overrides

        :param quizid: ID of quiz to get overrides for (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_overrides_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetOverridesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_get_overrides_without_preload_content(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="ID of quiz to get overrides for")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get quiz overrides

        Get quiz overrides

        :param quizid: ID of quiz to get overrides for (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_overrides_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetOverridesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_get_overrides_serialize(
        self,
        quizid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_get_overrides'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_get_overrides'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_get_overrides',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_get_quiz_access_information_args(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return access information for a given quiz.

        Return access information for a given quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_quiz_access_information_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizAccessInformationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_get_quiz_access_information(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizGetQuizAccessInformationResponse:
        """Return access information for a given quiz.

        Return access information for a given quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_quiz_access_information_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_quiz_access_information_from_args(
        self,
        args
    ) -> ModQuizGetQuizAccessInformationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizAccessInformationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_quiz_access_information_with_http_info(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizGetQuizAccessInformationResponse]:
        """Return access information for a given quiz.

        Return access information for a given quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_quiz_access_information_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_get_quiz_access_information_without_preload_content(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return access information for a given quiz.

        Return access information for a given quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_quiz_access_information_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_get_quiz_access_information_serialize(
        self,
        quizid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_get_quiz_access_information'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_get_quiz_access_information'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_get_quiz_access_information',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_get_quiz_feedback_for_grade_args(
        self,
        grade: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="the grade to check")],
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the feedback text that should be show to a student who got the given grade in the given quiz.

        Get the feedback text that should be show to a student who got the given grade in the given quiz.

        :param grade: the grade to check (required)
        :type grade: float
        :param quizid: quiz instance id (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_quiz_feedback_for_grade_serialize(
            grade=grade,
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizFeedbackForGradeResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_get_quiz_feedback_for_grade(
        self,
        grade: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="the grade to check")],
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizGetQuizFeedbackForGradeResponse:
        """Get the feedback text that should be show to a student who got the given grade in the given quiz.

        Get the feedback text that should be show to a student who got the given grade in the given quiz.

        :param grade: the grade to check (required)
        :type grade: float
        :param quizid: quiz instance id (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_quiz_feedback_for_grade_serialize(
            grade=grade,
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizFeedbackForGradeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_quiz_feedback_for_grade_from_args(
        self,
        args
    ) -> ModQuizGetQuizFeedbackForGradeResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizFeedbackForGradeResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_quiz_feedback_for_grade_with_http_info(
        self,
        grade: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="the grade to check")],
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizGetQuizFeedbackForGradeResponse]:
        """Get the feedback text that should be show to a student who got the given grade in the given quiz.

        Get the feedback text that should be show to a student who got the given grade in the given quiz.

        :param grade: the grade to check (required)
        :type grade: float
        :param quizid: quiz instance id (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_quiz_feedback_for_grade_serialize(
            grade=grade,
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizFeedbackForGradeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_get_quiz_feedback_for_grade_without_preload_content(
        self,
        grade: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="the grade to check")],
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the feedback text that should be show to a student who got the given grade in the given quiz.

        Get the feedback text that should be show to a student who got the given grade in the given quiz.

        :param grade: the grade to check (required)
        :type grade: float
        :param quizid: quiz instance id (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_quiz_feedback_for_grade_serialize(
            grade=grade,
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizFeedbackForGradeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_get_quiz_feedback_for_grade_serialize(
        self,
        grade,
        quizid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_get_quiz_feedback_for_grade'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_get_quiz_feedback_for_grade'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_get_quiz_feedback_for_grade',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if grade is not None:
            _form_params += parse_form({'grade': grade})
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_get_quiz_required_qtypes_args(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the potential question types that would be required for a given quiz.

        Return the potential question types that would be required for a given quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_quiz_required_qtypes_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizRequiredQtypesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_get_quiz_required_qtypes(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizGetQuizRequiredQtypesResponse:
        """Return the potential question types that would be required for a given quiz.

        Return the potential question types that would be required for a given quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_quiz_required_qtypes_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizRequiredQtypesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_quiz_required_qtypes_from_args(
        self,
        args
    ) -> ModQuizGetQuizRequiredQtypesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizRequiredQtypesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_quiz_required_qtypes_with_http_info(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizGetQuizRequiredQtypesResponse]:
        """Return the potential question types that would be required for a given quiz.

        Return the potential question types that would be required for a given quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_quiz_required_qtypes_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizRequiredQtypesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_get_quiz_required_qtypes_without_preload_content(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the potential question types that would be required for a given quiz.

        Return the potential question types that would be required for a given quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_quiz_required_qtypes_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizRequiredQtypesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_get_quiz_required_qtypes_serialize(
        self,
        quizid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_get_quiz_required_qtypes'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_get_quiz_required_qtypes'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_get_quiz_required_qtypes',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_get_quizzes_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of quizzes in a provided list of courses,                             if no list is provided all quizzes that the user can view will be returned.

        Returns a list of quizzes in a provided list of courses,                             if no list is provided all quizzes that the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_quizzes_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizzesByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_get_quizzes_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizGetQuizzesByCoursesResponse:
        """Returns a list of quizzes in a provided list of courses,                             if no list is provided all quizzes that the user can view will be returned.

        Returns a list of quizzes in a provided list of courses,                             if no list is provided all quizzes that the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_quizzes_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizzesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_quizzes_by_courses_from_args(
        self,
        args
    ) -> ModQuizGetQuizzesByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizzesByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_quizzes_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizGetQuizzesByCoursesResponse]:
        """Returns a list of quizzes in a provided list of courses,                             if no list is provided all quizzes that the user can view will be returned.

        Returns a list of quizzes in a provided list of courses,                             if no list is provided all quizzes that the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_quizzes_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizzesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_get_quizzes_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of quizzes in a provided list of courses,                             if no list is provided all quizzes that the user can view will be returned.

        Returns a list of quizzes in a provided list of courses,                             if no list is provided all quizzes that the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_quizzes_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetQuizzesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_get_quizzes_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_get_quizzes_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_get_quizzes_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_get_quizzes_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_get_reopen_attempt_confirmation_args(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="The id of the attempt to reopen")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Verify it is OK to re-open a given quiz attempt, and if so, return a suitable confirmation message.

        Verify it is OK to re-open a given quiz attempt, and if so, return a suitable confirmation message.

        :param attemptid: The id of the attempt to reopen (required)
        :type attemptid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_reopen_attempt_confirmation_serialize(
            attemptid=attemptid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_get_reopen_attempt_confirmation(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="The id of the attempt to reopen")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """Verify it is OK to re-open a given quiz attempt, and if so, return a suitable confirmation message.

        Verify it is OK to re-open a given quiz attempt, and if so, return a suitable confirmation message.

        :param attemptid: The id of the attempt to reopen (required)
        :type attemptid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_reopen_attempt_confirmation_serialize(
            attemptid=attemptid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_reopen_attempt_confirmation_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_reopen_attempt_confirmation_with_http_info(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="The id of the attempt to reopen")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """Verify it is OK to re-open a given quiz attempt, and if so, return a suitable confirmation message.

        Verify it is OK to re-open a given quiz attempt, and if so, return a suitable confirmation message.

        :param attemptid: The id of the attempt to reopen (required)
        :type attemptid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_reopen_attempt_confirmation_serialize(
            attemptid=attemptid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_get_reopen_attempt_confirmation_without_preload_content(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="The id of the attempt to reopen")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Verify it is OK to re-open a given quiz attempt, and if so, return a suitable confirmation message.

        Verify it is OK to re-open a given quiz attempt, and if so, return a suitable confirmation message.

        :param attemptid: The id of the attempt to reopen (required)
        :type attemptid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_reopen_attempt_confirmation_serialize(
            attemptid=attemptid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_get_reopen_attempt_confirmation_serialize(
        self,
        attemptid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_get_reopen_attempt_confirmation'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_get_reopen_attempt_confirmation'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_get_reopen_attempt_confirmation',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attemptid is not None:
            _form_params += parse_form({'attemptid': attemptid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_get_user_attempts_args(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        includepreviews: Annotated[Optional[StrictBool], Field(description="whether to include previews or not")] = None,
        status: Annotated[Optional[StrictStr], Field(description="quiz status: all, finished or unfinished")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="user id, empty for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return a list of attempts for the given quiz and user. (Deprecated in favour of mod_quiz_get_user_quiz_attempts).

        Return a list of attempts for the given quiz and user. (Deprecated in favour of mod_quiz_get_user_quiz_attempts).

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param includepreviews: whether to include previews or not
        :type includepreviews: bool
        :param status: quiz status: all, finished or unfinished
        :type status: str
        :param userid: user id, empty for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_user_attempts_serialize(
            quizid=quizid,
            includepreviews=includepreviews,
            status=status,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetUserAttemptsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_get_user_attempts(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        includepreviews: Annotated[Optional[StrictBool], Field(description="whether to include previews or not")] = None,
        status: Annotated[Optional[StrictStr], Field(description="quiz status: all, finished or unfinished")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="user id, empty for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizGetUserAttemptsResponse:
        """Return a list of attempts for the given quiz and user. (Deprecated in favour of mod_quiz_get_user_quiz_attempts).

        Return a list of attempts for the given quiz and user. (Deprecated in favour of mod_quiz_get_user_quiz_attempts).

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param includepreviews: whether to include previews or not
        :type includepreviews: bool
        :param status: quiz status: all, finished or unfinished
        :type status: str
        :param userid: user id, empty for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_user_attempts_serialize(
            quizid=quizid,
            includepreviews=includepreviews,
            status=status,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetUserAttemptsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_user_attempts_from_args(
        self,
        args
    ) -> ModQuizGetUserAttemptsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetUserAttemptsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_user_attempts_with_http_info(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        includepreviews: Annotated[Optional[StrictBool], Field(description="whether to include previews or not")] = None,
        status: Annotated[Optional[StrictStr], Field(description="quiz status: all, finished or unfinished")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="user id, empty for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizGetUserAttemptsResponse]:
        """Return a list of attempts for the given quiz and user. (Deprecated in favour of mod_quiz_get_user_quiz_attempts).

        Return a list of attempts for the given quiz and user. (Deprecated in favour of mod_quiz_get_user_quiz_attempts).

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param includepreviews: whether to include previews or not
        :type includepreviews: bool
        :param status: quiz status: all, finished or unfinished
        :type status: str
        :param userid: user id, empty for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_user_attempts_serialize(
            quizid=quizid,
            includepreviews=includepreviews,
            status=status,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetUserAttemptsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_get_user_attempts_without_preload_content(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        includepreviews: Annotated[Optional[StrictBool], Field(description="whether to include previews or not")] = None,
        status: Annotated[Optional[StrictStr], Field(description="quiz status: all, finished or unfinished")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="user id, empty for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return a list of attempts for the given quiz and user. (Deprecated in favour of mod_quiz_get_user_quiz_attempts).

        Return a list of attempts for the given quiz and user. (Deprecated in favour of mod_quiz_get_user_quiz_attempts).

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param includepreviews: whether to include previews or not
        :type includepreviews: bool
        :param status: quiz status: all, finished or unfinished
        :type status: str
        :param userid: user id, empty for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_user_attempts_serialize(
            quizid=quizid,
            includepreviews=includepreviews,
            status=status,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetUserAttemptsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_get_user_attempts_serialize(
        self,
        quizid,
        includepreviews,
        status,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_get_user_attempts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_get_user_attempts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_get_user_attempts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if includepreviews is not None:
            _form_params += parse_form({'includepreviews': includepreviews})
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        if status is not None:
            _form_params += parse_form({'status': status})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_get_user_best_grade_args(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the best current grade for the given user on a quiz.

        Get the best current grade for the given user on a quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param userid: user id
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_user_best_grade_serialize(
            quizid=quizid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetUserBestGradeResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_get_user_best_grade(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizGetUserBestGradeResponse:
        """Get the best current grade for the given user on a quiz.

        Get the best current grade for the given user on a quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param userid: user id
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_user_best_grade_serialize(
            quizid=quizid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetUserBestGradeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_user_best_grade_from_args(
        self,
        args
    ) -> ModQuizGetUserBestGradeResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetUserBestGradeResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_user_best_grade_with_http_info(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizGetUserBestGradeResponse]:
        """Get the best current grade for the given user on a quiz.

        Get the best current grade for the given user on a quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param userid: user id
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_user_best_grade_serialize(
            quizid=quizid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetUserBestGradeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_get_user_best_grade_without_preload_content(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the best current grade for the given user on a quiz.

        Get the best current grade for the given user on a quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param userid: user id
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_user_best_grade_serialize(
            quizid=quizid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetUserBestGradeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_get_user_best_grade_serialize(
        self,
        quizid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_get_user_best_grade'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_get_user_best_grade'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_get_user_best_grade',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_get_user_quiz_attempts_args(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        includepreviews: Annotated[Optional[StrictBool], Field(description="whether to include previews or not")] = None,
        status: Annotated[Optional[StrictStr], Field(description="quiz status: all, finished or unfinished")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="user id, empty for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return a list of attempts for the given quiz and user.

        Return a list of attempts for the given quiz and user.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param includepreviews: whether to include previews or not
        :type includepreviews: bool
        :param status: quiz status: all, finished or unfinished
        :type status: str
        :param userid: user id, empty for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_user_quiz_attempts_serialize(
            quizid=quizid,
            includepreviews=includepreviews,
            status=status,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetUserQuizAttemptsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_get_user_quiz_attempts(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        includepreviews: Annotated[Optional[StrictBool], Field(description="whether to include previews or not")] = None,
        status: Annotated[Optional[StrictStr], Field(description="quiz status: all, finished or unfinished")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="user id, empty for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizGetUserQuizAttemptsResponse:
        """Return a list of attempts for the given quiz and user.

        Return a list of attempts for the given quiz and user.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param includepreviews: whether to include previews or not
        :type includepreviews: bool
        :param status: quiz status: all, finished or unfinished
        :type status: str
        :param userid: user id, empty for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_user_quiz_attempts_serialize(
            quizid=quizid,
            includepreviews=includepreviews,
            status=status,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetUserQuizAttemptsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_user_quiz_attempts_from_args(
        self,
        args
    ) -> ModQuizGetUserQuizAttemptsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetUserQuizAttemptsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_get_user_quiz_attempts_with_http_info(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        includepreviews: Annotated[Optional[StrictBool], Field(description="whether to include previews or not")] = None,
        status: Annotated[Optional[StrictStr], Field(description="quiz status: all, finished or unfinished")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="user id, empty for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizGetUserQuizAttemptsResponse]:
        """Return a list of attempts for the given quiz and user.

        Return a list of attempts for the given quiz and user.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param includepreviews: whether to include previews or not
        :type includepreviews: bool
        :param status: quiz status: all, finished or unfinished
        :type status: str
        :param userid: user id, empty for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_user_quiz_attempts_serialize(
            quizid=quizid,
            includepreviews=includepreviews,
            status=status,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetUserQuizAttemptsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_get_user_quiz_attempts_without_preload_content(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        includepreviews: Annotated[Optional[StrictBool], Field(description="whether to include previews or not")] = None,
        status: Annotated[Optional[StrictStr], Field(description="quiz status: all, finished or unfinished")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="user id, empty for current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return a list of attempts for the given quiz and user.

        Return a list of attempts for the given quiz and user.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param includepreviews: whether to include previews or not
        :type includepreviews: bool
        :param status: quiz status: all, finished or unfinished
        :type status: str
        :param userid: user id, empty for current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_get_user_quiz_attempts_serialize(
            quizid=quizid,
            includepreviews=includepreviews,
            status=status,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizGetUserQuizAttemptsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_get_user_quiz_attempts_serialize(
        self,
        quizid,
        includepreviews,
        status,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_get_user_quiz_attempts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_get_user_quiz_attempts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_get_user_quiz_attempts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if includepreviews is not None:
            _form_params += parse_form({'includepreviews': includepreviews})
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        if status is not None:
            _form_params += parse_form({'status': status})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_process_attempt_args(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        data: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="the data to be saved")] = None,
        finishattempt: Annotated[Optional[StrictBool], Field(description="whether to finish or not the attempt")] = None,
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        timeup: Annotated[Optional[StrictBool], Field(description="whether the WS was called by a timer when the time is up")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Process responses during an attempt at a quiz and also deals with attempts finishing.

        Process responses during an attempt at a quiz and also deals with attempts finishing.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param data: the data to be saved
        :type data: List[ModLessonProcessPageParametersDataInner]
        :param finishattempt: whether to finish or not the attempt
        :type finishattempt: bool
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param timeup: whether the WS was called by a timer when the time is up
        :type timeup: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_process_attempt_serialize(
            attemptid=attemptid,
            data=data,
            finishattempt=finishattempt,
            preflightdata=preflightdata,
            timeup=timeup,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizProcessAttemptResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_process_attempt(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        data: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="the data to be saved")] = None,
        finishattempt: Annotated[Optional[StrictBool], Field(description="whether to finish or not the attempt")] = None,
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        timeup: Annotated[Optional[StrictBool], Field(description="whether the WS was called by a timer when the time is up")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizProcessAttemptResponse:
        """Process responses during an attempt at a quiz and also deals with attempts finishing.

        Process responses during an attempt at a quiz and also deals with attempts finishing.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param data: the data to be saved
        :type data: List[ModLessonProcessPageParametersDataInner]
        :param finishattempt: whether to finish or not the attempt
        :type finishattempt: bool
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param timeup: whether the WS was called by a timer when the time is up
        :type timeup: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_process_attempt_serialize(
            attemptid=attemptid,
            data=data,
            finishattempt=finishattempt,
            preflightdata=preflightdata,
            timeup=timeup,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizProcessAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_process_attempt_from_args(
        self,
        args
    ) -> ModQuizProcessAttemptResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizProcessAttemptResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_process_attempt_with_http_info(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        data: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="the data to be saved")] = None,
        finishattempt: Annotated[Optional[StrictBool], Field(description="whether to finish or not the attempt")] = None,
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        timeup: Annotated[Optional[StrictBool], Field(description="whether the WS was called by a timer when the time is up")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizProcessAttemptResponse]:
        """Process responses during an attempt at a quiz and also deals with attempts finishing.

        Process responses during an attempt at a quiz and also deals with attempts finishing.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param data: the data to be saved
        :type data: List[ModLessonProcessPageParametersDataInner]
        :param finishattempt: whether to finish or not the attempt
        :type finishattempt: bool
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param timeup: whether the WS was called by a timer when the time is up
        :type timeup: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_process_attempt_serialize(
            attemptid=attemptid,
            data=data,
            finishattempt=finishattempt,
            preflightdata=preflightdata,
            timeup=timeup,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizProcessAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_process_attempt_without_preload_content(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        data: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="the data to be saved")] = None,
        finishattempt: Annotated[Optional[StrictBool], Field(description="whether to finish or not the attempt")] = None,
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        timeup: Annotated[Optional[StrictBool], Field(description="whether the WS was called by a timer when the time is up")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Process responses during an attempt at a quiz and also deals with attempts finishing.

        Process responses during an attempt at a quiz and also deals with attempts finishing.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param data: the data to be saved
        :type data: List[ModLessonProcessPageParametersDataInner]
        :param finishattempt: whether to finish or not the attempt
        :type finishattempt: bool
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param timeup: whether the WS was called by a timer when the time is up
        :type timeup: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_process_attempt_serialize(
            attemptid=attemptid,
            data=data,
            finishattempt=finishattempt,
            preflightdata=preflightdata,
            timeup=timeup,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizProcessAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_process_attempt_serialize(
        self,
        attemptid,
        data,
        finishattempt,
        preflightdata,
        timeup,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'data': 'csv',
            'preflightdata': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_process_attempt'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_process_attempt'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_process_attempt',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attemptid is not None:
            _form_params += parse_form({'attemptid': attemptid})
        if data is not None:
            _form_params += parse_form({'data': data})
        if finishattempt is not None:
            _form_params += parse_form({'finishattempt': finishattempt})
        if preflightdata is not None:
            _form_params += parse_form({'preflightdata': preflightdata})
        if timeup is not None:
            _form_params += parse_form({'timeup': timeup})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_reopen_attempt_args(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="The id of the attempt to reopen")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Re-open an attempt that is currently in the never submitted state.

        Re-open an attempt that is currently in the never submitted state.

        :param attemptid: The id of the attempt to reopen (required)
        :type attemptid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_reopen_attempt_serialize(
            attemptid=attemptid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_reopen_attempt(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="The id of the attempt to reopen")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Re-open an attempt that is currently in the never submitted state.

        Re-open an attempt that is currently in the never submitted state.

        :param attemptid: The id of the attempt to reopen (required)
        :type attemptid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_reopen_attempt_serialize(
            attemptid=attemptid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_reopen_attempt_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_reopen_attempt_with_http_info(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="The id of the attempt to reopen")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Re-open an attempt that is currently in the never submitted state.

        Re-open an attempt that is currently in the never submitted state.

        :param attemptid: The id of the attempt to reopen (required)
        :type attemptid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_reopen_attempt_serialize(
            attemptid=attemptid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_reopen_attempt_without_preload_content(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="The id of the attempt to reopen")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Re-open an attempt that is currently in the never submitted state.

        Re-open an attempt that is currently in the never submitted state.

        :param attemptid: The id of the attempt to reopen (required)
        :type attemptid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_reopen_attempt_serialize(
            attemptid=attemptid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_reopen_attempt_serialize(
        self,
        attemptid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_reopen_attempt'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_reopen_attempt'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_reopen_attempt',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attemptid is not None:
            _form_params += parse_form({'attemptid': attemptid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_save_attempt_args(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        data: Annotated[List[ModLessonProcessPageParametersDataInner], Field(description="the data to be saved")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Processes save requests during the quiz.                             This function is intended for the quiz auto-save feature.

        Processes save requests during the quiz.                             This function is intended for the quiz auto-save feature.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param data: the data to be saved (required)
        :type data: List[ModLessonProcessPageParametersDataInner]
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_save_attempt_serialize(
            attemptid=attemptid,
            data=data,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizSaveAttemptResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_save_attempt(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        data: Annotated[List[ModLessonProcessPageParametersDataInner], Field(description="the data to be saved")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizSaveAttemptResponse:
        """Processes save requests during the quiz.                             This function is intended for the quiz auto-save feature.

        Processes save requests during the quiz.                             This function is intended for the quiz auto-save feature.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param data: the data to be saved (required)
        :type data: List[ModLessonProcessPageParametersDataInner]
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_save_attempt_serialize(
            attemptid=attemptid,
            data=data,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizSaveAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_save_attempt_from_args(
        self,
        args
    ) -> ModQuizSaveAttemptResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizSaveAttemptResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_save_attempt_with_http_info(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        data: Annotated[List[ModLessonProcessPageParametersDataInner], Field(description="the data to be saved")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizSaveAttemptResponse]:
        """Processes save requests during the quiz.                             This function is intended for the quiz auto-save feature.

        Processes save requests during the quiz.                             This function is intended for the quiz auto-save feature.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param data: the data to be saved (required)
        :type data: List[ModLessonProcessPageParametersDataInner]
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_save_attempt_serialize(
            attemptid=attemptid,
            data=data,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizSaveAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_save_attempt_without_preload_content(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        data: Annotated[List[ModLessonProcessPageParametersDataInner], Field(description="the data to be saved")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Processes save requests during the quiz.                             This function is intended for the quiz auto-save feature.

        Processes save requests during the quiz.                             This function is intended for the quiz auto-save feature.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param data: the data to be saved (required)
        :type data: List[ModLessonProcessPageParametersDataInner]
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_save_attempt_serialize(
            attemptid=attemptid,
            data=data,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizSaveAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_save_attempt_serialize(
        self,
        attemptid,
        data,
        preflightdata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'data': 'csv',
            'preflightdata': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_save_attempt'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_save_attempt'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_save_attempt',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attemptid is not None:
            _form_params += parse_form({'attemptid': attemptid})
        if data is not None:
            _form_params += parse_form({'data': data})
        if preflightdata is not None:
            _form_params += parse_form({'preflightdata': preflightdata})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_save_overrides_args(
        self,
        data: ModQuizSaveOverridesParametersData,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update or insert quiz overrides

        Update or insert quiz overrides

        :param data: (required)
        :type data: ModQuizSaveOverridesParametersData
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_save_overrides_serialize(
            data=data,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizSaveOverridesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_save_overrides(
        self,
        data: ModQuizSaveOverridesParametersData,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizSaveOverridesResponse:
        """Update or insert quiz overrides

        Update or insert quiz overrides

        :param data: (required)
        :type data: ModQuizSaveOverridesParametersData
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_save_overrides_serialize(
            data=data,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizSaveOverridesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_save_overrides_from_args(
        self,
        args
    ) -> ModQuizSaveOverridesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizSaveOverridesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_save_overrides_with_http_info(
        self,
        data: ModQuizSaveOverridesParametersData,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizSaveOverridesResponse]:
        """Update or insert quiz overrides

        Update or insert quiz overrides

        :param data: (required)
        :type data: ModQuizSaveOverridesParametersData
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_save_overrides_serialize(
            data=data,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizSaveOverridesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_save_overrides_without_preload_content(
        self,
        data: ModQuizSaveOverridesParametersData,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update or insert quiz overrides

        Update or insert quiz overrides

        :param data: (required)
        :type data: ModQuizSaveOverridesParametersData
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_save_overrides_serialize(
            data=data,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizSaveOverridesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_save_overrides_serialize(
        self,
        data,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_save_overrides'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_save_overrides'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_save_overrides',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if data is not None:
            _form_params += parse_form({'data': data})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_set_question_version_args(
        self,
        newversion: Optional[StrictInt],
        slotid: Optional[StrictInt],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set the version of question that would be required for a given quiz.

        Set the version of question that would be required for a given quiz.

        :param newversion: (required)
        :type newversion: int
        :param slotid: (required)
        :type slotid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_set_question_version_serialize(
            newversion=newversion,
            slotid=slotid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizSetQuestionVersionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_set_question_version(
        self,
        newversion: Optional[StrictInt],
        slotid: Optional[StrictInt],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizSetQuestionVersionResponse:
        """Set the version of question that would be required for a given quiz.

        Set the version of question that would be required for a given quiz.

        :param newversion: (required)
        :type newversion: int
        :param slotid: (required)
        :type slotid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_set_question_version_serialize(
            newversion=newversion,
            slotid=slotid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizSetQuestionVersionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_set_question_version_from_args(
        self,
        args
    ) -> ModQuizSetQuestionVersionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizSetQuestionVersionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_set_question_version_with_http_info(
        self,
        newversion: Optional[StrictInt],
        slotid: Optional[StrictInt],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizSetQuestionVersionResponse]:
        """Set the version of question that would be required for a given quiz.

        Set the version of question that would be required for a given quiz.

        :param newversion: (required)
        :type newversion: int
        :param slotid: (required)
        :type slotid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_set_question_version_serialize(
            newversion=newversion,
            slotid=slotid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizSetQuestionVersionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_set_question_version_without_preload_content(
        self,
        newversion: Optional[StrictInt],
        slotid: Optional[StrictInt],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set the version of question that would be required for a given quiz.

        Set the version of question that would be required for a given quiz.

        :param newversion: (required)
        :type newversion: int
        :param slotid: (required)
        :type slotid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_set_question_version_serialize(
            newversion=newversion,
            slotid=slotid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizSetQuestionVersionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_set_question_version_serialize(
        self,
        newversion,
        slotid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_set_question_version'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_set_question_version'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_set_question_version',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if newversion is not None:
            _form_params += parse_form({'newversion': newversion})
        if slotid is not None:
            _form_params += parse_form({'slotid': slotid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_start_attempt_args(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        forcenew: Annotated[Optional[StrictBool], Field(description="Whether to force a new attempt or not.")] = None,
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Starts a new attempt at a quiz.

        Starts a new attempt at a quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param forcenew: Whether to force a new attempt or not.
        :type forcenew: bool
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_start_attempt_serialize(
            quizid=quizid,
            forcenew=forcenew,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizStartAttemptResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_start_attempt(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        forcenew: Annotated[Optional[StrictBool], Field(description="Whether to force a new attempt or not.")] = None,
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizStartAttemptResponse:
        """Starts a new attempt at a quiz.

        Starts a new attempt at a quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param forcenew: Whether to force a new attempt or not.
        :type forcenew: bool
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_start_attempt_serialize(
            quizid=quizid,
            forcenew=forcenew,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizStartAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_start_attempt_from_args(
        self,
        args
    ) -> ModQuizStartAttemptResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizStartAttemptResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_start_attempt_with_http_info(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        forcenew: Annotated[Optional[StrictBool], Field(description="Whether to force a new attempt or not.")] = None,
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizStartAttemptResponse]:
        """Starts a new attempt at a quiz.

        Starts a new attempt at a quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param forcenew: Whether to force a new attempt or not.
        :type forcenew: bool
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_start_attempt_serialize(
            quizid=quizid,
            forcenew=forcenew,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizStartAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_start_attempt_without_preload_content(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        forcenew: Annotated[Optional[StrictBool], Field(description="Whether to force a new attempt or not.")] = None,
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Starts a new attempt at a quiz.

        Starts a new attempt at a quiz.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param forcenew: Whether to force a new attempt or not.
        :type forcenew: bool
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_start_attempt_serialize(
            quizid=quizid,
            forcenew=forcenew,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizStartAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_start_attempt_serialize(
        self,
        quizid,
        forcenew,
        preflightdata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'preflightdata': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_start_attempt'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_start_attempt'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_start_attempt',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if forcenew is not None:
            _form_params += parse_form({'forcenew': forcenew})
        if preflightdata is not None:
            _form_params += parse_form({'preflightdata': preflightdata})
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_update_filter_condition_args(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The cmid of the quiz")],
        filtercondition: Annotated[Optional[StrictStr], Field(description="Filter condition")],
        slotid: Annotated[Optional[StrictInt], Field(description="The quiz slot ID for the random question.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update filter condition for a random question slot.

        Update filter condition for a random question slot.

        :param cmid: The cmid of the quiz (required)
        :type cmid: int
        :param filtercondition: Filter condition (required)
        :type filtercondition: str
        :param slotid: The quiz slot ID for the random question. (required)
        :type slotid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_update_filter_condition_serialize(
            cmid=cmid,
            filtercondition=filtercondition,
            slotid=slotid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizUpdateFilterConditionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_update_filter_condition(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The cmid of the quiz")],
        filtercondition: Annotated[Optional[StrictStr], Field(description="Filter condition")],
        slotid: Annotated[Optional[StrictInt], Field(description="The quiz slot ID for the random question.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizUpdateFilterConditionResponse:
        """Update filter condition for a random question slot.

        Update filter condition for a random question slot.

        :param cmid: The cmid of the quiz (required)
        :type cmid: int
        :param filtercondition: Filter condition (required)
        :type filtercondition: str
        :param slotid: The quiz slot ID for the random question. (required)
        :type slotid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_update_filter_condition_serialize(
            cmid=cmid,
            filtercondition=filtercondition,
            slotid=slotid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizUpdateFilterConditionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_update_filter_condition_from_args(
        self,
        args
    ) -> ModQuizUpdateFilterConditionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizUpdateFilterConditionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_update_filter_condition_with_http_info(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The cmid of the quiz")],
        filtercondition: Annotated[Optional[StrictStr], Field(description="Filter condition")],
        slotid: Annotated[Optional[StrictInt], Field(description="The quiz slot ID for the random question.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizUpdateFilterConditionResponse]:
        """Update filter condition for a random question slot.

        Update filter condition for a random question slot.

        :param cmid: The cmid of the quiz (required)
        :type cmid: int
        :param filtercondition: Filter condition (required)
        :type filtercondition: str
        :param slotid: The quiz slot ID for the random question. (required)
        :type slotid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_update_filter_condition_serialize(
            cmid=cmid,
            filtercondition=filtercondition,
            slotid=slotid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizUpdateFilterConditionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_update_filter_condition_without_preload_content(
        self,
        cmid: Annotated[Optional[StrictInt], Field(description="The cmid of the quiz")],
        filtercondition: Annotated[Optional[StrictStr], Field(description="Filter condition")],
        slotid: Annotated[Optional[StrictInt], Field(description="The quiz slot ID for the random question.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update filter condition for a random question slot.

        Update filter condition for a random question slot.

        :param cmid: The cmid of the quiz (required)
        :type cmid: int
        :param filtercondition: Filter condition (required)
        :type filtercondition: str
        :param slotid: The quiz slot ID for the random question. (required)
        :type slotid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_update_filter_condition_serialize(
            cmid=cmid,
            filtercondition=filtercondition,
            slotid=slotid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizUpdateFilterConditionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_update_filter_condition_serialize(
        self,
        cmid,
        filtercondition,
        slotid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_update_filter_condition'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_update_filter_condition'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_update_filter_condition',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        if filtercondition is not None:
            _form_params += parse_form({'filtercondition': filtercondition})
        if slotid is not None:
            _form_params += parse_form({'slotid': slotid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_update_grade_items_args(
        self,
        quizgradeitems: List[ModQuizUpdateGradeItemsParametersQuizgradeitemsInner],
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update quiz grade items. All grade items must belong to the same quiz.

        Update quiz grade items. All grade items must belong to the same quiz.

        :param quizgradeitems: (required)
        :type quizgradeitems: List[ModQuizUpdateGradeItemsParametersQuizgradeitemsInner]
        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_update_grade_items_serialize(
            quizgradeitems=quizgradeitems,
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_update_grade_items(
        self,
        quizgradeitems: List[ModQuizUpdateGradeItemsParametersQuizgradeitemsInner],
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Update quiz grade items. All grade items must belong to the same quiz.

        Update quiz grade items. All grade items must belong to the same quiz.

        :param quizgradeitems: (required)
        :type quizgradeitems: List[ModQuizUpdateGradeItemsParametersQuizgradeitemsInner]
        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_update_grade_items_serialize(
            quizgradeitems=quizgradeitems,
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_update_grade_items_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_update_grade_items_with_http_info(
        self,
        quizgradeitems: List[ModQuizUpdateGradeItemsParametersQuizgradeitemsInner],
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Update quiz grade items. All grade items must belong to the same quiz.

        Update quiz grade items. All grade items must belong to the same quiz.

        :param quizgradeitems: (required)
        :type quizgradeitems: List[ModQuizUpdateGradeItemsParametersQuizgradeitemsInner]
        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_update_grade_items_serialize(
            quizgradeitems=quizgradeitems,
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_update_grade_items_without_preload_content(
        self,
        quizgradeitems: List[ModQuizUpdateGradeItemsParametersQuizgradeitemsInner],
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update quiz grade items. All grade items must belong to the same quiz.

        Update quiz grade items. All grade items must belong to the same quiz.

        :param quizgradeitems: (required)
        :type quizgradeitems: List[ModQuizUpdateGradeItemsParametersQuizgradeitemsInner]
        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_update_grade_items_serialize(
            quizgradeitems=quizgradeitems,
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_update_grade_items_serialize(
        self,
        quizgradeitems,
        quizid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'quizgradeitems': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_update_grade_items'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_update_grade_items'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_update_grade_items',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if quizgradeitems is not None:
            _form_params += parse_form({'quizgradeitems': quizgradeitems})
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_update_slots_args(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        slots: List[ModQuizUpdateSlotsParametersSlotsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update the properties of slots in a quiz. All slots must belong to the same quiz.

        Update the properties of slots in a quiz. All slots must belong to the same quiz.

        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param slots: (required)
        :type slots: List[ModQuizUpdateSlotsParametersSlotsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_update_slots_serialize(
            quizid=quizid,
            slots=slots,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_update_slots(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        slots: List[ModQuizUpdateSlotsParametersSlotsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Update the properties of slots in a quiz. All slots must belong to the same quiz.

        Update the properties of slots in a quiz. All slots must belong to the same quiz.

        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param slots: (required)
        :type slots: List[ModQuizUpdateSlotsParametersSlotsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_update_slots_serialize(
            quizid=quizid,
            slots=slots,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_update_slots_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_update_slots_with_http_info(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        slots: List[ModQuizUpdateSlotsParametersSlotsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Update the properties of slots in a quiz. All slots must belong to the same quiz.

        Update the properties of slots in a quiz. All slots must belong to the same quiz.

        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param slots: (required)
        :type slots: List[ModQuizUpdateSlotsParametersSlotsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_update_slots_serialize(
            quizid=quizid,
            slots=slots,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_update_slots_without_preload_content(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="The quiz to update slots for.")],
        slots: List[ModQuizUpdateSlotsParametersSlotsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update the properties of slots in a quiz. All slots must belong to the same quiz.

        Update the properties of slots in a quiz. All slots must belong to the same quiz.

        :param quizid: The quiz to update slots for. (required)
        :type quizid: int
        :param slots: (required)
        :type slots: List[ModQuizUpdateSlotsParametersSlotsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_update_slots_serialize(
            quizid=quizid,
            slots=slots,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_update_slots_serialize(
        self,
        quizid,
        slots,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'slots': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_update_slots'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_update_slots'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_update_slots',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        if slots is not None:
            _form_params += parse_form({'slots': slots})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_view_attempt_args(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        page: Annotated[Optional[StrictInt], Field(description="page number")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the attempt viewed event.

        Trigger the attempt viewed event.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param page: page number (required)
        :type page: int
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_view_attempt_serialize(
            attemptid=attemptid,
            page=page,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewAttemptResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_view_attempt(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        page: Annotated[Optional[StrictInt], Field(description="page number")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizViewAttemptResponse:
        """Trigger the attempt viewed event.

        Trigger the attempt viewed event.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param page: page number (required)
        :type page: int
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_view_attempt_serialize(
            attemptid=attemptid,
            page=page,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_view_attempt_from_args(
        self,
        args
    ) -> ModQuizViewAttemptResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewAttemptResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_view_attempt_with_http_info(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        page: Annotated[Optional[StrictInt], Field(description="page number")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizViewAttemptResponse]:
        """Trigger the attempt viewed event.

        Trigger the attempt viewed event.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param page: page number (required)
        :type page: int
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_view_attempt_serialize(
            attemptid=attemptid,
            page=page,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_view_attempt_without_preload_content(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        page: Annotated[Optional[StrictInt], Field(description="page number")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the attempt viewed event.

        Trigger the attempt viewed event.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param page: page number (required)
        :type page: int
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_view_attempt_serialize(
            attemptid=attemptid,
            page=page,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewAttemptResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_view_attempt_serialize(
        self,
        attemptid,
        page,
        preflightdata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'preflightdata': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_view_attempt'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_view_attempt'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_view_attempt',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attemptid is not None:
            _form_params += parse_form({'attemptid': attemptid})
        if page is not None:
            _form_params += parse_form({'page': page})
        if preflightdata is not None:
            _form_params += parse_form({'preflightdata': preflightdata})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_view_attempt_review_args(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the attempt reviewed event.

        Trigger the attempt reviewed event.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_view_attempt_review_serialize(
            attemptid=attemptid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewAttemptReviewResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_view_attempt_review(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizViewAttemptReviewResponse:
        """Trigger the attempt reviewed event.

        Trigger the attempt reviewed event.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_view_attempt_review_serialize(
            attemptid=attemptid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewAttemptReviewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_view_attempt_review_from_args(
        self,
        args
    ) -> ModQuizViewAttemptReviewResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewAttemptReviewResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_view_attempt_review_with_http_info(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizViewAttemptReviewResponse]:
        """Trigger the attempt reviewed event.

        Trigger the attempt reviewed event.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_view_attempt_review_serialize(
            attemptid=attemptid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewAttemptReviewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_view_attempt_review_without_preload_content(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the attempt reviewed event.

        Trigger the attempt reviewed event.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_view_attempt_review_serialize(
            attemptid=attemptid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewAttemptReviewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_view_attempt_review_serialize(
        self,
        attemptid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_view_attempt_review'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_view_attempt_review'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_view_attempt_review',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attemptid is not None:
            _form_params += parse_form({'attemptid': attemptid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_view_attempt_summary_args(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the attempt summary viewed event.

        Trigger the attempt summary viewed event.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_view_attempt_summary_serialize(
            attemptid=attemptid,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewAttemptSummaryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_view_attempt_summary(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizViewAttemptSummaryResponse:
        """Trigger the attempt summary viewed event.

        Trigger the attempt summary viewed event.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_view_attempt_summary_serialize(
            attemptid=attemptid,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewAttemptSummaryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_view_attempt_summary_from_args(
        self,
        args
    ) -> ModQuizViewAttemptSummaryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewAttemptSummaryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_view_attempt_summary_with_http_info(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizViewAttemptSummaryResponse]:
        """Trigger the attempt summary viewed event.

        Trigger the attempt summary viewed event.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_view_attempt_summary_serialize(
            attemptid=attemptid,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewAttemptSummaryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_view_attempt_summary_without_preload_content(
        self,
        attemptid: Annotated[Optional[StrictInt], Field(description="attempt id")],
        preflightdata: Annotated[Optional[List[ModLessonProcessPageParametersDataInner]], Field(description="Preflight required data (like passwords)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the attempt summary viewed event.

        Trigger the attempt summary viewed event.

        :param attemptid: attempt id (required)
        :type attemptid: int
        :param preflightdata: Preflight required data (like passwords)
        :type preflightdata: List[ModLessonProcessPageParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_view_attempt_summary_serialize(
            attemptid=attemptid,
            preflightdata=preflightdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewAttemptSummaryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_view_attempt_summary_serialize(
        self,
        attemptid,
        preflightdata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'preflightdata': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_view_attempt_summary'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_view_attempt_summary'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_view_attempt_summary',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attemptid is not None:
            _form_params += parse_form({'attemptid': attemptid})
        if preflightdata is not None:
            _form_params += parse_form({'preflightdata': preflightdata})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_quiz_view_quiz_args(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_view_quiz_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewQuizResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_quiz_view_quiz(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModQuizViewQuizResponse:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_view_quiz_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewQuizResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_view_quiz_from_args(
        self,
        args
    ) -> ModQuizViewQuizResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewQuizResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_quiz_view_quiz_with_http_info(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModQuizViewQuizResponse]:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_view_quiz_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewQuizResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_quiz_view_quiz_without_preload_content(
        self,
        quizid: Annotated[Optional[StrictInt], Field(description="quiz instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param quizid: quiz instance id (required)
        :type quizid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_quiz_view_quiz_serialize(
            quizid=quizid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModQuizViewQuizResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_quiz_view_quiz_serialize(
        self,
        quizid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_quiz_view_quiz'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_quiz_view_quiz'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_quiz_view_quiz',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if quizid is not None:
            _form_params += parse_form({'quizid': quizid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_resource_get_resources_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of files in a provided list of courses, if no list is provided all files that                             the user can view will be returned.

        Returns a list of files in a provided list of courses, if no list is provided all files that                             the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_resource_get_resources_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModResourceGetResourcesByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_resource_get_resources_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModResourceGetResourcesByCoursesResponse:
        """Returns a list of files in a provided list of courses, if no list is provided all files that                             the user can view will be returned.

        Returns a list of files in a provided list of courses, if no list is provided all files that                             the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_resource_get_resources_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModResourceGetResourcesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_resource_get_resources_by_courses_from_args(
        self,
        args
    ) -> ModResourceGetResourcesByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModResourceGetResourcesByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_resource_get_resources_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModResourceGetResourcesByCoursesResponse]:
        """Returns a list of files in a provided list of courses, if no list is provided all files that                             the user can view will be returned.

        Returns a list of files in a provided list of courses, if no list is provided all files that                             the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_resource_get_resources_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModResourceGetResourcesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_resource_get_resources_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of files in a provided list of courses, if no list is provided all files that                             the user can view will be returned.

        Returns a list of files in a provided list of courses, if no list is provided all files that                             the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_resource_get_resources_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModResourceGetResourcesByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_resource_get_resources_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_resource_get_resources_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_resource_get_resources_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_resource_get_resources_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_resource_view_resource_args(
        self,
        resourceid: Annotated[Optional[StrictInt], Field(description="resource instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Simulate the view.php web interface resource: trigger events, completion, etc...

        Simulate the view.php web interface resource: trigger events, completion, etc...

        :param resourceid: resource instance id (required)
        :type resourceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_resource_view_resource_serialize(
            resourceid=resourceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModResourceViewResourceResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_resource_view_resource(
        self,
        resourceid: Annotated[Optional[StrictInt], Field(description="resource instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModResourceViewResourceResponse:
        """Simulate the view.php web interface resource: trigger events, completion, etc...

        Simulate the view.php web interface resource: trigger events, completion, etc...

        :param resourceid: resource instance id (required)
        :type resourceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_resource_view_resource_serialize(
            resourceid=resourceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModResourceViewResourceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_resource_view_resource_from_args(
        self,
        args
    ) -> ModResourceViewResourceResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModResourceViewResourceResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_resource_view_resource_with_http_info(
        self,
        resourceid: Annotated[Optional[StrictInt], Field(description="resource instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModResourceViewResourceResponse]:
        """Simulate the view.php web interface resource: trigger events, completion, etc...

        Simulate the view.php web interface resource: trigger events, completion, etc...

        :param resourceid: resource instance id (required)
        :type resourceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_resource_view_resource_serialize(
            resourceid=resourceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModResourceViewResourceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_resource_view_resource_without_preload_content(
        self,
        resourceid: Annotated[Optional[StrictInt], Field(description="resource instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Simulate the view.php web interface resource: trigger events, completion, etc...

        Simulate the view.php web interface resource: trigger events, completion, etc...

        :param resourceid: resource instance id (required)
        :type resourceid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_resource_view_resource_serialize(
            resourceid=resourceid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModResourceViewResourceResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_resource_view_resource_serialize(
        self,
        resourceid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_resource_view_resource'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_resource_view_resource'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_resource_view_resource',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if resourceid is not None:
            _form_params += parse_form({'resourceid': resourceid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_scorm_get_scorm_access_information_args(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="scorm instance id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return capabilities information for a given scorm.

        Return capabilities information for a given scorm.

        :param scormid: scorm instance id. (required)
        :type scormid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_access_information_serialize(
            scormid=scormid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormAccessInformationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_scorm_get_scorm_access_information(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="scorm instance id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModScormGetScormAccessInformationResponse:
        """Return capabilities information for a given scorm.

        Return capabilities information for a given scorm.

        :param scormid: scorm instance id. (required)
        :type scormid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_access_information_serialize(
            scormid=scormid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_get_scorm_access_information_from_args(
        self,
        args
    ) -> ModScormGetScormAccessInformationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormAccessInformationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_get_scorm_access_information_with_http_info(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="scorm instance id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModScormGetScormAccessInformationResponse]:
        """Return capabilities information for a given scorm.

        Return capabilities information for a given scorm.

        :param scormid: scorm instance id. (required)
        :type scormid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_access_information_serialize(
            scormid=scormid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_scorm_get_scorm_access_information_without_preload_content(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="scorm instance id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return capabilities information for a given scorm.

        Return capabilities information for a given scorm.

        :param scormid: scorm instance id. (required)
        :type scormid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_access_information_serialize(
            scormid=scormid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_scorm_get_scorm_access_information_serialize(
        self,
        scormid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_scorm_get_scorm_access_information'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_scorm_get_scorm_access_information'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_scorm_get_scorm_access_information',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if scormid is not None:
            _form_params += parse_form({'scormid': scormid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_scorm_get_scorm_attempt_count_args(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="SCORM instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="User id")],
        ignoremissingcompletion: Annotated[Optional[StrictBool], Field(description="Ignores attempts that haven't reported a grade/completion")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the number of attempts done by a user in the given SCORM.

        Return the number of attempts done by a user in the given SCORM.

        :param scormid: SCORM instance id (required)
        :type scormid: int
        :param userid: User id (required)
        :type userid: int
        :param ignoremissingcompletion: Ignores attempts that haven't reported a grade/completion
        :type ignoremissingcompletion: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_attempt_count_serialize(
            scormid=scormid,
            userid=userid,
            ignoremissingcompletion=ignoremissingcompletion,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormAttemptCountResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_scorm_get_scorm_attempt_count(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="SCORM instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="User id")],
        ignoremissingcompletion: Annotated[Optional[StrictBool], Field(description="Ignores attempts that haven't reported a grade/completion")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModScormGetScormAttemptCountResponse:
        """Return the number of attempts done by a user in the given SCORM.

        Return the number of attempts done by a user in the given SCORM.

        :param scormid: SCORM instance id (required)
        :type scormid: int
        :param userid: User id (required)
        :type userid: int
        :param ignoremissingcompletion: Ignores attempts that haven't reported a grade/completion
        :type ignoremissingcompletion: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_attempt_count_serialize(
            scormid=scormid,
            userid=userid,
            ignoremissingcompletion=ignoremissingcompletion,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormAttemptCountResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_get_scorm_attempt_count_from_args(
        self,
        args
    ) -> ModScormGetScormAttemptCountResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormAttemptCountResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_get_scorm_attempt_count_with_http_info(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="SCORM instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="User id")],
        ignoremissingcompletion: Annotated[Optional[StrictBool], Field(description="Ignores attempts that haven't reported a grade/completion")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModScormGetScormAttemptCountResponse]:
        """Return the number of attempts done by a user in the given SCORM.

        Return the number of attempts done by a user in the given SCORM.

        :param scormid: SCORM instance id (required)
        :type scormid: int
        :param userid: User id (required)
        :type userid: int
        :param ignoremissingcompletion: Ignores attempts that haven't reported a grade/completion
        :type ignoremissingcompletion: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_attempt_count_serialize(
            scormid=scormid,
            userid=userid,
            ignoremissingcompletion=ignoremissingcompletion,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormAttemptCountResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_scorm_get_scorm_attempt_count_without_preload_content(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="SCORM instance id")],
        userid: Annotated[Optional[StrictInt], Field(description="User id")],
        ignoremissingcompletion: Annotated[Optional[StrictBool], Field(description="Ignores attempts that haven't reported a grade/completion")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the number of attempts done by a user in the given SCORM.

        Return the number of attempts done by a user in the given SCORM.

        :param scormid: SCORM instance id (required)
        :type scormid: int
        :param userid: User id (required)
        :type userid: int
        :param ignoremissingcompletion: Ignores attempts that haven't reported a grade/completion
        :type ignoremissingcompletion: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_attempt_count_serialize(
            scormid=scormid,
            userid=userid,
            ignoremissingcompletion=ignoremissingcompletion,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormAttemptCountResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_scorm_get_scorm_attempt_count_serialize(
        self,
        scormid,
        userid,
        ignoremissingcompletion,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_scorm_get_scorm_attempt_count'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_scorm_get_scorm_attempt_count'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_scorm_get_scorm_attempt_count',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if ignoremissingcompletion is not None:
            _form_params += parse_form({'ignoremissingcompletion': ignoremissingcompletion})
        if scormid is not None:
            _form_params += parse_form({'scormid': scormid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_scorm_get_scorm_sco_tracks_args(
        self,
        scoid: Annotated[Optional[StrictInt], Field(description="sco id")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")],
        attempt: Annotated[Optional[StrictInt], Field(description="attempt number (0 for last attempt)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves SCO tracking data for the given user id and attempt number

        Retrieves SCO tracking data for the given user id and attempt number

        :param scoid: sco id (required)
        :type scoid: int
        :param userid: user id (required)
        :type userid: int
        :param attempt: attempt number (0 for last attempt)
        :type attempt: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_sco_tracks_serialize(
            scoid=scoid,
            userid=userid,
            attempt=attempt,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormScoTracksResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_scorm_get_scorm_sco_tracks(
        self,
        scoid: Annotated[Optional[StrictInt], Field(description="sco id")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")],
        attempt: Annotated[Optional[StrictInt], Field(description="attempt number (0 for last attempt)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModScormGetScormScoTracksResponse:
        """Retrieves SCO tracking data for the given user id and attempt number

        Retrieves SCO tracking data for the given user id and attempt number

        :param scoid: sco id (required)
        :type scoid: int
        :param userid: user id (required)
        :type userid: int
        :param attempt: attempt number (0 for last attempt)
        :type attempt: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_sco_tracks_serialize(
            scoid=scoid,
            userid=userid,
            attempt=attempt,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormScoTracksResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_get_scorm_sco_tracks_from_args(
        self,
        args
    ) -> ModScormGetScormScoTracksResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormScoTracksResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_get_scorm_sco_tracks_with_http_info(
        self,
        scoid: Annotated[Optional[StrictInt], Field(description="sco id")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")],
        attempt: Annotated[Optional[StrictInt], Field(description="attempt number (0 for last attempt)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModScormGetScormScoTracksResponse]:
        """Retrieves SCO tracking data for the given user id and attempt number

        Retrieves SCO tracking data for the given user id and attempt number

        :param scoid: sco id (required)
        :type scoid: int
        :param userid: user id (required)
        :type userid: int
        :param attempt: attempt number (0 for last attempt)
        :type attempt: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_sco_tracks_serialize(
            scoid=scoid,
            userid=userid,
            attempt=attempt,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormScoTracksResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_scorm_get_scorm_sco_tracks_without_preload_content(
        self,
        scoid: Annotated[Optional[StrictInt], Field(description="sco id")],
        userid: Annotated[Optional[StrictInt], Field(description="user id")],
        attempt: Annotated[Optional[StrictInt], Field(description="attempt number (0 for last attempt)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves SCO tracking data for the given user id and attempt number

        Retrieves SCO tracking data for the given user id and attempt number

        :param scoid: sco id (required)
        :type scoid: int
        :param userid: user id (required)
        :type userid: int
        :param attempt: attempt number (0 for last attempt)
        :type attempt: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_sco_tracks_serialize(
            scoid=scoid,
            userid=userid,
            attempt=attempt,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormScoTracksResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_scorm_get_scorm_sco_tracks_serialize(
        self,
        scoid,
        userid,
        attempt,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_scorm_get_scorm_sco_tracks'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_scorm_get_scorm_sco_tracks'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_scorm_get_scorm_sco_tracks',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attempt is not None:
            _form_params += parse_form({'attempt': attempt})
        if scoid is not None:
            _form_params += parse_form({'scoid': scoid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_scorm_get_scorm_scoes_args(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="scorm instance id")],
        organization: Annotated[Optional[StrictStr], Field(description="organization id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list containing all the scoes data related to the given scorm id

        Returns a list containing all the scoes data related to the given scorm id

        :param scormid: scorm instance id (required)
        :type scormid: int
        :param organization: organization id
        :type organization: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_scoes_serialize(
            scormid=scormid,
            organization=organization,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormScoesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_scorm_get_scorm_scoes(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="scorm instance id")],
        organization: Annotated[Optional[StrictStr], Field(description="organization id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModScormGetScormScoesResponse:
        """Returns a list containing all the scoes data related to the given scorm id

        Returns a list containing all the scoes data related to the given scorm id

        :param scormid: scorm instance id (required)
        :type scormid: int
        :param organization: organization id
        :type organization: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_scoes_serialize(
            scormid=scormid,
            organization=organization,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormScoesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_get_scorm_scoes_from_args(
        self,
        args
    ) -> ModScormGetScormScoesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormScoesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_get_scorm_scoes_with_http_info(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="scorm instance id")],
        organization: Annotated[Optional[StrictStr], Field(description="organization id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModScormGetScormScoesResponse]:
        """Returns a list containing all the scoes data related to the given scorm id

        Returns a list containing all the scoes data related to the given scorm id

        :param scormid: scorm instance id (required)
        :type scormid: int
        :param organization: organization id
        :type organization: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_scoes_serialize(
            scormid=scormid,
            organization=organization,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormScoesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_scorm_get_scorm_scoes_without_preload_content(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="scorm instance id")],
        organization: Annotated[Optional[StrictStr], Field(description="organization id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list containing all the scoes data related to the given scorm id

        Returns a list containing all the scoes data related to the given scorm id

        :param scormid: scorm instance id (required)
        :type scormid: int
        :param organization: organization id
        :type organization: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_scoes_serialize(
            scormid=scormid,
            organization=organization,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormScoesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_scorm_get_scorm_scoes_serialize(
        self,
        scormid,
        organization,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_scorm_get_scorm_scoes'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_scorm_get_scorm_scoes'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_scorm_get_scorm_scoes',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if organization is not None:
            _form_params += parse_form({'organization': organization})
        if scormid is not None:
            _form_params += parse_form({'scormid': scormid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_scorm_get_scorm_user_data_args(
        self,
        attempt: Annotated[Optional[StrictInt], Field(description="attempt number")],
        scormid: Annotated[Optional[StrictInt], Field(description="scorm instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves user tracking and SCO data and default SCORM values

        Retrieves user tracking and SCO data and default SCORM values

        :param attempt: attempt number (required)
        :type attempt: int
        :param scormid: scorm instance id (required)
        :type scormid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_user_data_serialize(
            attempt=attempt,
            scormid=scormid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormUserDataResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_scorm_get_scorm_user_data(
        self,
        attempt: Annotated[Optional[StrictInt], Field(description="attempt number")],
        scormid: Annotated[Optional[StrictInt], Field(description="scorm instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModScormGetScormUserDataResponse:
        """Retrieves user tracking and SCO data and default SCORM values

        Retrieves user tracking and SCO data and default SCORM values

        :param attempt: attempt number (required)
        :type attempt: int
        :param scormid: scorm instance id (required)
        :type scormid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_user_data_serialize(
            attempt=attempt,
            scormid=scormid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormUserDataResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_get_scorm_user_data_from_args(
        self,
        args
    ) -> ModScormGetScormUserDataResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormUserDataResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_get_scorm_user_data_with_http_info(
        self,
        attempt: Annotated[Optional[StrictInt], Field(description="attempt number")],
        scormid: Annotated[Optional[StrictInt], Field(description="scorm instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModScormGetScormUserDataResponse]:
        """Retrieves user tracking and SCO data and default SCORM values

        Retrieves user tracking and SCO data and default SCORM values

        :param attempt: attempt number (required)
        :type attempt: int
        :param scormid: scorm instance id (required)
        :type scormid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_user_data_serialize(
            attempt=attempt,
            scormid=scormid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormUserDataResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_scorm_get_scorm_user_data_without_preload_content(
        self,
        attempt: Annotated[Optional[StrictInt], Field(description="attempt number")],
        scormid: Annotated[Optional[StrictInt], Field(description="scorm instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves user tracking and SCO data and default SCORM values

        Retrieves user tracking and SCO data and default SCORM values

        :param attempt: attempt number (required)
        :type attempt: int
        :param scormid: scorm instance id (required)
        :type scormid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorm_user_data_serialize(
            attempt=attempt,
            scormid=scormid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormUserDataResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_scorm_get_scorm_user_data_serialize(
        self,
        attempt,
        scormid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_scorm_get_scorm_user_data'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_scorm_get_scorm_user_data'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_scorm_get_scorm_user_data',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attempt is not None:
            _form_params += parse_form({'attempt': attempt})
        if scormid is not None:
            _form_params += parse_form({'scormid': scormid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_scorm_get_scorms_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of scorm instances in a provided set of courses, if                             no courses are provided then all the scorm instances the user has access to will be returned.

        Returns a list of scorm instances in a provided set of courses, if                             no courses are provided then all the scorm instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorms_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormsByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_scorm_get_scorms_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModScormGetScormsByCoursesResponse:
        """Returns a list of scorm instances in a provided set of courses, if                             no courses are provided then all the scorm instances the user has access to will be returned.

        Returns a list of scorm instances in a provided set of courses, if                             no courses are provided then all the scorm instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorms_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_get_scorms_by_courses_from_args(
        self,
        args
    ) -> ModScormGetScormsByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormsByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_get_scorms_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModScormGetScormsByCoursesResponse]:
        """Returns a list of scorm instances in a provided set of courses, if                             no courses are provided then all the scorm instances the user has access to will be returned.

        Returns a list of scorm instances in a provided set of courses, if                             no courses are provided then all the scorm instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorms_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_scorm_get_scorms_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of scorm instances in a provided set of courses, if                             no courses are provided then all the scorm instances the user has access to will be returned.

        Returns a list of scorm instances in a provided set of courses, if                             no courses are provided then all the scorm instances the user has access to will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_get_scorms_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormGetScormsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_scorm_get_scorms_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_scorm_get_scorms_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_scorm_get_scorms_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_scorm_get_scorms_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_scorm_insert_scorm_tracks_args(
        self,
        attempt: Annotated[Optional[StrictInt], Field(description="attempt number")],
        scoid: Annotated[Optional[StrictInt], Field(description="SCO id")],
        tracks: List[ModScormGetScormScoesResponseScoesInnerExtradataInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Saves a scorm tracking record.                           It will overwrite any existing tracking data for this attempt.                           Validation should be performed before running the function to ensure the user will not lose any existing                           attempt data.

        Saves a scorm tracking record.                           It will overwrite any existing tracking data for this attempt.                           Validation should be performed before running the function to ensure the user will not lose any existing                           attempt data.

        :param attempt: attempt number (required)
        :type attempt: int
        :param scoid: SCO id (required)
        :type scoid: int
        :param tracks: (required)
        :type tracks: List[ModScormGetScormScoesResponseScoesInnerExtradataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_insert_scorm_tracks_serialize(
            attempt=attempt,
            scoid=scoid,
            tracks=tracks,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormInsertScormTracksResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_scorm_insert_scorm_tracks(
        self,
        attempt: Annotated[Optional[StrictInt], Field(description="attempt number")],
        scoid: Annotated[Optional[StrictInt], Field(description="SCO id")],
        tracks: List[ModScormGetScormScoesResponseScoesInnerExtradataInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModScormInsertScormTracksResponse:
        """Saves a scorm tracking record.                           It will overwrite any existing tracking data for this attempt.                           Validation should be performed before running the function to ensure the user will not lose any existing                           attempt data.

        Saves a scorm tracking record.                           It will overwrite any existing tracking data for this attempt.                           Validation should be performed before running the function to ensure the user will not lose any existing                           attempt data.

        :param attempt: attempt number (required)
        :type attempt: int
        :param scoid: SCO id (required)
        :type scoid: int
        :param tracks: (required)
        :type tracks: List[ModScormGetScormScoesResponseScoesInnerExtradataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_insert_scorm_tracks_serialize(
            attempt=attempt,
            scoid=scoid,
            tracks=tracks,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormInsertScormTracksResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_insert_scorm_tracks_from_args(
        self,
        args
    ) -> ModScormInsertScormTracksResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormInsertScormTracksResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_insert_scorm_tracks_with_http_info(
        self,
        attempt: Annotated[Optional[StrictInt], Field(description="attempt number")],
        scoid: Annotated[Optional[StrictInt], Field(description="SCO id")],
        tracks: List[ModScormGetScormScoesResponseScoesInnerExtradataInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModScormInsertScormTracksResponse]:
        """Saves a scorm tracking record.                           It will overwrite any existing tracking data for this attempt.                           Validation should be performed before running the function to ensure the user will not lose any existing                           attempt data.

        Saves a scorm tracking record.                           It will overwrite any existing tracking data for this attempt.                           Validation should be performed before running the function to ensure the user will not lose any existing                           attempt data.

        :param attempt: attempt number (required)
        :type attempt: int
        :param scoid: SCO id (required)
        :type scoid: int
        :param tracks: (required)
        :type tracks: List[ModScormGetScormScoesResponseScoesInnerExtradataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_insert_scorm_tracks_serialize(
            attempt=attempt,
            scoid=scoid,
            tracks=tracks,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormInsertScormTracksResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_scorm_insert_scorm_tracks_without_preload_content(
        self,
        attempt: Annotated[Optional[StrictInt], Field(description="attempt number")],
        scoid: Annotated[Optional[StrictInt], Field(description="SCO id")],
        tracks: List[ModScormGetScormScoesResponseScoesInnerExtradataInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Saves a scorm tracking record.                           It will overwrite any existing tracking data for this attempt.                           Validation should be performed before running the function to ensure the user will not lose any existing                           attempt data.

        Saves a scorm tracking record.                           It will overwrite any existing tracking data for this attempt.                           Validation should be performed before running the function to ensure the user will not lose any existing                           attempt data.

        :param attempt: attempt number (required)
        :type attempt: int
        :param scoid: SCO id (required)
        :type scoid: int
        :param tracks: (required)
        :type tracks: List[ModScormGetScormScoesResponseScoesInnerExtradataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_insert_scorm_tracks_serialize(
            attempt=attempt,
            scoid=scoid,
            tracks=tracks,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormInsertScormTracksResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_scorm_insert_scorm_tracks_serialize(
        self,
        attempt,
        scoid,
        tracks,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'tracks': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_scorm_insert_scorm_tracks'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_scorm_insert_scorm_tracks'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_scorm_insert_scorm_tracks',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attempt is not None:
            _form_params += parse_form({'attempt': attempt})
        if scoid is not None:
            _form_params += parse_form({'scoid': scoid})
        if tracks is not None:
            _form_params += parse_form({'tracks': tracks})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_scorm_launch_sco_args(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="SCORM instance id")],
        scoid: Annotated[Optional[StrictInt], Field(description="SCO id (empty for launching the first SCO)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the SCO launched event.

        Trigger the SCO launched event.

        :param scormid: SCORM instance id (required)
        :type scormid: int
        :param scoid: SCO id (empty for launching the first SCO)
        :type scoid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_launch_sco_serialize(
            scormid=scormid,
            scoid=scoid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormLaunchScoResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_scorm_launch_sco(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="SCORM instance id")],
        scoid: Annotated[Optional[StrictInt], Field(description="SCO id (empty for launching the first SCO)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModScormLaunchScoResponse:
        """Trigger the SCO launched event.

        Trigger the SCO launched event.

        :param scormid: SCORM instance id (required)
        :type scormid: int
        :param scoid: SCO id (empty for launching the first SCO)
        :type scoid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_launch_sco_serialize(
            scormid=scormid,
            scoid=scoid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormLaunchScoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_launch_sco_from_args(
        self,
        args
    ) -> ModScormLaunchScoResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormLaunchScoResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_launch_sco_with_http_info(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="SCORM instance id")],
        scoid: Annotated[Optional[StrictInt], Field(description="SCO id (empty for launching the first SCO)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModScormLaunchScoResponse]:
        """Trigger the SCO launched event.

        Trigger the SCO launched event.

        :param scormid: SCORM instance id (required)
        :type scormid: int
        :param scoid: SCO id (empty for launching the first SCO)
        :type scoid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_launch_sco_serialize(
            scormid=scormid,
            scoid=scoid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormLaunchScoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_scorm_launch_sco_without_preload_content(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="SCORM instance id")],
        scoid: Annotated[Optional[StrictInt], Field(description="SCO id (empty for launching the first SCO)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the SCO launched event.

        Trigger the SCO launched event.

        :param scormid: SCORM instance id (required)
        :type scormid: int
        :param scoid: SCO id (empty for launching the first SCO)
        :type scoid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_launch_sco_serialize(
            scormid=scormid,
            scoid=scoid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormLaunchScoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_scorm_launch_sco_serialize(
        self,
        scormid,
        scoid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_scorm_launch_sco'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_scorm_launch_sco'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_scorm_launch_sco',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if scoid is not None:
            _form_params += parse_form({'scoid': scoid})
        if scormid is not None:
            _form_params += parse_form({'scormid': scormid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_scorm_view_scorm_args(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="scorm instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the course module viewed event.

        Trigger the course module viewed event.

        :param scormid: scorm instance id (required)
        :type scormid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_view_scorm_serialize(
            scormid=scormid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormViewScormResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_scorm_view_scorm(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="scorm instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModScormViewScormResponse:
        """Trigger the course module viewed event.

        Trigger the course module viewed event.

        :param scormid: scorm instance id (required)
        :type scormid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_view_scorm_serialize(
            scormid=scormid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormViewScormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_view_scorm_from_args(
        self,
        args
    ) -> ModScormViewScormResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormViewScormResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_scorm_view_scorm_with_http_info(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="scorm instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModScormViewScormResponse]:
        """Trigger the course module viewed event.

        Trigger the course module viewed event.

        :param scormid: scorm instance id (required)
        :type scormid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_view_scorm_serialize(
            scormid=scormid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormViewScormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_scorm_view_scorm_without_preload_content(
        self,
        scormid: Annotated[Optional[StrictInt], Field(description="scorm instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the course module viewed event.

        Trigger the course module viewed event.

        :param scormid: scorm instance id (required)
        :type scormid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_scorm_view_scorm_serialize(
            scormid=scormid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModScormViewScormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_scorm_view_scorm_serialize(
        self,
        scormid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_scorm_view_scorm'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_scorm_view_scorm'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_scorm_view_scorm',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if scormid is not None:
            _form_params += parse_form({'scormid': scormid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_url_get_urls_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of urls in a provided list of courses, if no list is provided all urls that the user                             can view will be returned.

        Returns a list of urls in a provided list of courses, if no list is provided all urls that the user                             can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_url_get_urls_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModUrlGetUrlsByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_url_get_urls_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModUrlGetUrlsByCoursesResponse:
        """Returns a list of urls in a provided list of courses, if no list is provided all urls that the user                             can view will be returned.

        Returns a list of urls in a provided list of courses, if no list is provided all urls that the user                             can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_url_get_urls_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModUrlGetUrlsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_url_get_urls_by_courses_from_args(
        self,
        args
    ) -> ModUrlGetUrlsByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModUrlGetUrlsByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_url_get_urls_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModUrlGetUrlsByCoursesResponse]:
        """Returns a list of urls in a provided list of courses, if no list is provided all urls that the user                             can view will be returned.

        Returns a list of urls in a provided list of courses, if no list is provided all urls that the user                             can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_url_get_urls_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModUrlGetUrlsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_url_get_urls_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of urls in a provided list of courses, if no list is provided all urls that the user                             can view will be returned.

        Returns a list of urls in a provided list of courses, if no list is provided all urls that the user                             can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_url_get_urls_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModUrlGetUrlsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_url_get_urls_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_url_get_urls_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_url_get_urls_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_url_get_urls_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_url_view_url_args(
        self,
        urlid: Annotated[Optional[StrictInt], Field(description="url instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param urlid: url instance id (required)
        :type urlid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_url_view_url_serialize(
            urlid=urlid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModUrlViewUrlResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_url_view_url(
        self,
        urlid: Annotated[Optional[StrictInt], Field(description="url instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModUrlViewUrlResponse:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param urlid: url instance id (required)
        :type urlid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_url_view_url_serialize(
            urlid=urlid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModUrlViewUrlResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_url_view_url_from_args(
        self,
        args
    ) -> ModUrlViewUrlResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModUrlViewUrlResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_url_view_url_with_http_info(
        self,
        urlid: Annotated[Optional[StrictInt], Field(description="url instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModUrlViewUrlResponse]:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param urlid: url instance id (required)
        :type urlid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_url_view_url_serialize(
            urlid=urlid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModUrlViewUrlResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_url_view_url_without_preload_content(
        self,
        urlid: Annotated[Optional[StrictInt], Field(description="url instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param urlid: url instance id (required)
        :type urlid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_url_view_url_serialize(
            urlid=urlid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModUrlViewUrlResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_url_view_url_serialize(
        self,
        urlid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_url_view_url'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_url_view_url'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_url_view_url',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if urlid is not None:
            _form_params += parse_form({'urlid': urlid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_wiki_edit_page_args(
        self,
        content: Annotated[Optional[StrictStr], Field(description="Page contents.")],
        pageid: Annotated[Optional[StrictInt], Field(description="Page ID.")],
        section: Annotated[Optional[StrictStr], Field(description="Section page title.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Save the contents of a page.

        Save the contents of a page.

        :param content: Page contents. (required)
        :type content: str
        :param pageid: Page ID. (required)
        :type pageid: int
        :param section: Section page title.
        :type section: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_edit_page_serialize(
            content=content,
            pageid=pageid,
            section=section,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiEditPageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_wiki_edit_page(
        self,
        content: Annotated[Optional[StrictStr], Field(description="Page contents.")],
        pageid: Annotated[Optional[StrictInt], Field(description="Page ID.")],
        section: Annotated[Optional[StrictStr], Field(description="Section page title.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWikiEditPageResponse:
        """Save the contents of a page.

        Save the contents of a page.

        :param content: Page contents. (required)
        :type content: str
        :param pageid: Page ID. (required)
        :type pageid: int
        :param section: Section page title.
        :type section: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_edit_page_serialize(
            content=content,
            pageid=pageid,
            section=section,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiEditPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_edit_page_from_args(
        self,
        args
    ) -> ModWikiEditPageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiEditPageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_edit_page_with_http_info(
        self,
        content: Annotated[Optional[StrictStr], Field(description="Page contents.")],
        pageid: Annotated[Optional[StrictInt], Field(description="Page ID.")],
        section: Annotated[Optional[StrictStr], Field(description="Section page title.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWikiEditPageResponse]:
        """Save the contents of a page.

        Save the contents of a page.

        :param content: Page contents. (required)
        :type content: str
        :param pageid: Page ID. (required)
        :type pageid: int
        :param section: Section page title.
        :type section: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_edit_page_serialize(
            content=content,
            pageid=pageid,
            section=section,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiEditPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_wiki_edit_page_without_preload_content(
        self,
        content: Annotated[Optional[StrictStr], Field(description="Page contents.")],
        pageid: Annotated[Optional[StrictInt], Field(description="Page ID.")],
        section: Annotated[Optional[StrictStr], Field(description="Section page title.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Save the contents of a page.

        Save the contents of a page.

        :param content: Page contents. (required)
        :type content: str
        :param pageid: Page ID. (required)
        :type pageid: int
        :param section: Section page title.
        :type section: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_edit_page_serialize(
            content=content,
            pageid=pageid,
            section=section,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiEditPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_wiki_edit_page_serialize(
        self,
        content,
        pageid,
        section,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_wiki_edit_page'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_wiki_edit_page'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_wiki_edit_page',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if content is not None:
            _form_params += parse_form({'content': content})
        if pageid is not None:
            _form_params += parse_form({'pageid': pageid})
        if section is not None:
            _form_params += parse_form({'section': section})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_wiki_get_page_contents_args(
        self,
        pageid: Annotated[Optional[StrictInt], Field(description="Page ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the contents of a page.

        Returns the contents of a page.

        :param pageid: Page ID. (required)
        :type pageid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_page_contents_serialize(
            pageid=pageid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetPageContentsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_wiki_get_page_contents(
        self,
        pageid: Annotated[Optional[StrictInt], Field(description="Page ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWikiGetPageContentsResponse:
        """Returns the contents of a page.

        Returns the contents of a page.

        :param pageid: Page ID. (required)
        :type pageid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_page_contents_serialize(
            pageid=pageid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetPageContentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_get_page_contents_from_args(
        self,
        args
    ) -> ModWikiGetPageContentsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetPageContentsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_get_page_contents_with_http_info(
        self,
        pageid: Annotated[Optional[StrictInt], Field(description="Page ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWikiGetPageContentsResponse]:
        """Returns the contents of a page.

        Returns the contents of a page.

        :param pageid: Page ID. (required)
        :type pageid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_page_contents_serialize(
            pageid=pageid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetPageContentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_wiki_get_page_contents_without_preload_content(
        self,
        pageid: Annotated[Optional[StrictInt], Field(description="Page ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the contents of a page.

        Returns the contents of a page.

        :param pageid: Page ID. (required)
        :type pageid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_page_contents_serialize(
            pageid=pageid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetPageContentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_wiki_get_page_contents_serialize(
        self,
        pageid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_wiki_get_page_contents'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_wiki_get_page_contents'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_wiki_get_page_contents',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if pageid is not None:
            _form_params += parse_form({'pageid': pageid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_wiki_get_page_for_editing_args(
        self,
        pageid: Annotated[Optional[StrictInt], Field(description="Page ID to edit.")],
        lockonly: Annotated[Optional[StrictBool], Field(description="Just renew lock and not return content.")] = None,
        section: Annotated[Optional[StrictStr], Field(description="Section page title.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Locks and retrieves info of page-section to be edited.

        Locks and retrieves info of page-section to be edited.

        :param pageid: Page ID to edit. (required)
        :type pageid: int
        :param lockonly: Just renew lock and not return content.
        :type lockonly: bool
        :param section: Section page title.
        :type section: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_page_for_editing_serialize(
            pageid=pageid,
            lockonly=lockonly,
            section=section,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetPageForEditingResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_wiki_get_page_for_editing(
        self,
        pageid: Annotated[Optional[StrictInt], Field(description="Page ID to edit.")],
        lockonly: Annotated[Optional[StrictBool], Field(description="Just renew lock and not return content.")] = None,
        section: Annotated[Optional[StrictStr], Field(description="Section page title.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWikiGetPageForEditingResponse:
        """Locks and retrieves info of page-section to be edited.

        Locks and retrieves info of page-section to be edited.

        :param pageid: Page ID to edit. (required)
        :type pageid: int
        :param lockonly: Just renew lock and not return content.
        :type lockonly: bool
        :param section: Section page title.
        :type section: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_page_for_editing_serialize(
            pageid=pageid,
            lockonly=lockonly,
            section=section,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetPageForEditingResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_get_page_for_editing_from_args(
        self,
        args
    ) -> ModWikiGetPageForEditingResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetPageForEditingResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_get_page_for_editing_with_http_info(
        self,
        pageid: Annotated[Optional[StrictInt], Field(description="Page ID to edit.")],
        lockonly: Annotated[Optional[StrictBool], Field(description="Just renew lock and not return content.")] = None,
        section: Annotated[Optional[StrictStr], Field(description="Section page title.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWikiGetPageForEditingResponse]:
        """Locks and retrieves info of page-section to be edited.

        Locks and retrieves info of page-section to be edited.

        :param pageid: Page ID to edit. (required)
        :type pageid: int
        :param lockonly: Just renew lock and not return content.
        :type lockonly: bool
        :param section: Section page title.
        :type section: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_page_for_editing_serialize(
            pageid=pageid,
            lockonly=lockonly,
            section=section,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetPageForEditingResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_wiki_get_page_for_editing_without_preload_content(
        self,
        pageid: Annotated[Optional[StrictInt], Field(description="Page ID to edit.")],
        lockonly: Annotated[Optional[StrictBool], Field(description="Just renew lock and not return content.")] = None,
        section: Annotated[Optional[StrictStr], Field(description="Section page title.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Locks and retrieves info of page-section to be edited.

        Locks and retrieves info of page-section to be edited.

        :param pageid: Page ID to edit. (required)
        :type pageid: int
        :param lockonly: Just renew lock and not return content.
        :type lockonly: bool
        :param section: Section page title.
        :type section: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_page_for_editing_serialize(
            pageid=pageid,
            lockonly=lockonly,
            section=section,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetPageForEditingResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_wiki_get_page_for_editing_serialize(
        self,
        pageid,
        lockonly,
        section,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_wiki_get_page_for_editing'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_wiki_get_page_for_editing'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_wiki_get_page_for_editing',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if lockonly is not None:
            _form_params += parse_form({'lockonly': lockonly})
        if pageid is not None:
            _form_params += parse_form({'pageid': pageid})
        if section is not None:
            _form_params += parse_form({'section': section})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_wiki_get_subwiki_files_args(
        self,
        wikiid: Annotated[Optional[StrictInt], Field(description="Wiki instance ID.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Subwiki's group ID, -1 means current group. It will be ignored if the wiki doesn't use groups.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Subwiki's user ID, 0 means current user. It will be ignored in collaborative wikis.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the list of files for a specific subwiki.

        Returns the list of files for a specific subwiki.

        :param wikiid: Wiki instance ID. (required)
        :type wikiid: int
        :param groupid: Subwiki's group ID, -1 means current group. It will be ignored if the wiki doesn't use groups.
        :type groupid: int
        :param userid: Subwiki's user ID, 0 means current user. It will be ignored in collaborative wikis.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_subwiki_files_serialize(
            wikiid=wikiid,
            groupid=groupid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetSubwikiFilesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_wiki_get_subwiki_files(
        self,
        wikiid: Annotated[Optional[StrictInt], Field(description="Wiki instance ID.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Subwiki's group ID, -1 means current group. It will be ignored if the wiki doesn't use groups.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Subwiki's user ID, 0 means current user. It will be ignored in collaborative wikis.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWikiGetSubwikiFilesResponse:
        """Returns the list of files for a specific subwiki.

        Returns the list of files for a specific subwiki.

        :param wikiid: Wiki instance ID. (required)
        :type wikiid: int
        :param groupid: Subwiki's group ID, -1 means current group. It will be ignored if the wiki doesn't use groups.
        :type groupid: int
        :param userid: Subwiki's user ID, 0 means current user. It will be ignored in collaborative wikis.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_subwiki_files_serialize(
            wikiid=wikiid,
            groupid=groupid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetSubwikiFilesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_get_subwiki_files_from_args(
        self,
        args
    ) -> ModWikiGetSubwikiFilesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetSubwikiFilesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_get_subwiki_files_with_http_info(
        self,
        wikiid: Annotated[Optional[StrictInt], Field(description="Wiki instance ID.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Subwiki's group ID, -1 means current group. It will be ignored if the wiki doesn't use groups.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Subwiki's user ID, 0 means current user. It will be ignored in collaborative wikis.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWikiGetSubwikiFilesResponse]:
        """Returns the list of files for a specific subwiki.

        Returns the list of files for a specific subwiki.

        :param wikiid: Wiki instance ID. (required)
        :type wikiid: int
        :param groupid: Subwiki's group ID, -1 means current group. It will be ignored if the wiki doesn't use groups.
        :type groupid: int
        :param userid: Subwiki's user ID, 0 means current user. It will be ignored in collaborative wikis.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_subwiki_files_serialize(
            wikiid=wikiid,
            groupid=groupid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetSubwikiFilesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_wiki_get_subwiki_files_without_preload_content(
        self,
        wikiid: Annotated[Optional[StrictInt], Field(description="Wiki instance ID.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Subwiki's group ID, -1 means current group. It will be ignored if the wiki doesn't use groups.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Subwiki's user ID, 0 means current user. It will be ignored in collaborative wikis.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the list of files for a specific subwiki.

        Returns the list of files for a specific subwiki.

        :param wikiid: Wiki instance ID. (required)
        :type wikiid: int
        :param groupid: Subwiki's group ID, -1 means current group. It will be ignored if the wiki doesn't use groups.
        :type groupid: int
        :param userid: Subwiki's user ID, 0 means current user. It will be ignored in collaborative wikis.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_subwiki_files_serialize(
            wikiid=wikiid,
            groupid=groupid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetSubwikiFilesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_wiki_get_subwiki_files_serialize(
        self,
        wikiid,
        groupid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_wiki_get_subwiki_files'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_wiki_get_subwiki_files'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_wiki_get_subwiki_files',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        if wikiid is not None:
            _form_params += parse_form({'wikiid': wikiid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_wiki_get_subwiki_pages_args(
        self,
        wikiid: Annotated[Optional[StrictInt], Field(description="Wiki instance ID.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Subwiki's group ID, -1 means current group. It will be ignored if the wiki doesn't use groups.")] = None,
        options: Optional[ModWikiGetSubwikiPagesParametersOptions] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Subwiki's user ID, 0 means current user. It will be ignored in collaborative wikis.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the list of pages for a specific subwiki.

        Returns the list of pages for a specific subwiki.

        :param wikiid: Wiki instance ID. (required)
        :type wikiid: int
        :param groupid: Subwiki's group ID, -1 means current group. It will be ignored if the wiki doesn't use groups.
        :type groupid: int
        :param options:
        :type options: ModWikiGetSubwikiPagesParametersOptions
        :param userid: Subwiki's user ID, 0 means current user. It will be ignored in collaborative wikis.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_subwiki_pages_serialize(
            wikiid=wikiid,
            groupid=groupid,
            options=options,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetSubwikiPagesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_wiki_get_subwiki_pages(
        self,
        wikiid: Annotated[Optional[StrictInt], Field(description="Wiki instance ID.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Subwiki's group ID, -1 means current group. It will be ignored if the wiki doesn't use groups.")] = None,
        options: Optional[ModWikiGetSubwikiPagesParametersOptions] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Subwiki's user ID, 0 means current user. It will be ignored in collaborative wikis.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWikiGetSubwikiPagesResponse:
        """Returns the list of pages for a specific subwiki.

        Returns the list of pages for a specific subwiki.

        :param wikiid: Wiki instance ID. (required)
        :type wikiid: int
        :param groupid: Subwiki's group ID, -1 means current group. It will be ignored if the wiki doesn't use groups.
        :type groupid: int
        :param options:
        :type options: ModWikiGetSubwikiPagesParametersOptions
        :param userid: Subwiki's user ID, 0 means current user. It will be ignored in collaborative wikis.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_subwiki_pages_serialize(
            wikiid=wikiid,
            groupid=groupid,
            options=options,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetSubwikiPagesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_get_subwiki_pages_from_args(
        self,
        args
    ) -> ModWikiGetSubwikiPagesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetSubwikiPagesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_get_subwiki_pages_with_http_info(
        self,
        wikiid: Annotated[Optional[StrictInt], Field(description="Wiki instance ID.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Subwiki's group ID, -1 means current group. It will be ignored if the wiki doesn't use groups.")] = None,
        options: Optional[ModWikiGetSubwikiPagesParametersOptions] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Subwiki's user ID, 0 means current user. It will be ignored in collaborative wikis.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWikiGetSubwikiPagesResponse]:
        """Returns the list of pages for a specific subwiki.

        Returns the list of pages for a specific subwiki.

        :param wikiid: Wiki instance ID. (required)
        :type wikiid: int
        :param groupid: Subwiki's group ID, -1 means current group. It will be ignored if the wiki doesn't use groups.
        :type groupid: int
        :param options:
        :type options: ModWikiGetSubwikiPagesParametersOptions
        :param userid: Subwiki's user ID, 0 means current user. It will be ignored in collaborative wikis.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_subwiki_pages_serialize(
            wikiid=wikiid,
            groupid=groupid,
            options=options,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetSubwikiPagesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_wiki_get_subwiki_pages_without_preload_content(
        self,
        wikiid: Annotated[Optional[StrictInt], Field(description="Wiki instance ID.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Subwiki's group ID, -1 means current group. It will be ignored if the wiki doesn't use groups.")] = None,
        options: Optional[ModWikiGetSubwikiPagesParametersOptions] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Subwiki's user ID, 0 means current user. It will be ignored in collaborative wikis.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the list of pages for a specific subwiki.

        Returns the list of pages for a specific subwiki.

        :param wikiid: Wiki instance ID. (required)
        :type wikiid: int
        :param groupid: Subwiki's group ID, -1 means current group. It will be ignored if the wiki doesn't use groups.
        :type groupid: int
        :param options:
        :type options: ModWikiGetSubwikiPagesParametersOptions
        :param userid: Subwiki's user ID, 0 means current user. It will be ignored in collaborative wikis.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_subwiki_pages_serialize(
            wikiid=wikiid,
            groupid=groupid,
            options=options,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetSubwikiPagesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_wiki_get_subwiki_pages_serialize(
        self,
        wikiid,
        groupid,
        options,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_wiki_get_subwiki_pages'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_wiki_get_subwiki_pages'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_wiki_get_subwiki_pages',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if options is not None:
            _form_params += parse_form({'options': options})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        if wikiid is not None:
            _form_params += parse_form({'wikiid': wikiid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_wiki_get_subwikis_args(
        self,
        wikiid: Annotated[Optional[StrictInt], Field(description="Wiki instance ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the list of subwikis the user can see in a specific wiki.

        Returns the list of subwikis the user can see in a specific wiki.

        :param wikiid: Wiki instance ID. (required)
        :type wikiid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_subwikis_serialize(
            wikiid=wikiid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetSubwikisResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_wiki_get_subwikis(
        self,
        wikiid: Annotated[Optional[StrictInt], Field(description="Wiki instance ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWikiGetSubwikisResponse:
        """Returns the list of subwikis the user can see in a specific wiki.

        Returns the list of subwikis the user can see in a specific wiki.

        :param wikiid: Wiki instance ID. (required)
        :type wikiid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_subwikis_serialize(
            wikiid=wikiid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetSubwikisResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_get_subwikis_from_args(
        self,
        args
    ) -> ModWikiGetSubwikisResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetSubwikisResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_get_subwikis_with_http_info(
        self,
        wikiid: Annotated[Optional[StrictInt], Field(description="Wiki instance ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWikiGetSubwikisResponse]:
        """Returns the list of subwikis the user can see in a specific wiki.

        Returns the list of subwikis the user can see in a specific wiki.

        :param wikiid: Wiki instance ID. (required)
        :type wikiid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_subwikis_serialize(
            wikiid=wikiid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetSubwikisResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_wiki_get_subwikis_without_preload_content(
        self,
        wikiid: Annotated[Optional[StrictInt], Field(description="Wiki instance ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the list of subwikis the user can see in a specific wiki.

        Returns the list of subwikis the user can see in a specific wiki.

        :param wikiid: Wiki instance ID. (required)
        :type wikiid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_subwikis_serialize(
            wikiid=wikiid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetSubwikisResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_wiki_get_subwikis_serialize(
        self,
        wikiid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_wiki_get_subwikis'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_wiki_get_subwikis'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_wiki_get_subwikis',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if wikiid is not None:
            _form_params += parse_form({'wikiid': wikiid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_wiki_get_wikis_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of wiki instances in a provided set of courses, if no courses are provided then all the wiki instances the user has access to will be returned.

        Returns a list of wiki instances in a provided set of courses, if no courses are provided then all the wiki instances the user has access to will be returned.

        :param courseids: Array of course ids.
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_wikis_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetWikisByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_wiki_get_wikis_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWikiGetWikisByCoursesResponse:
        """Returns a list of wiki instances in a provided set of courses, if no courses are provided then all the wiki instances the user has access to will be returned.

        Returns a list of wiki instances in a provided set of courses, if no courses are provided then all the wiki instances the user has access to will be returned.

        :param courseids: Array of course ids.
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_wikis_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetWikisByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_get_wikis_by_courses_from_args(
        self,
        args
    ) -> ModWikiGetWikisByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetWikisByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_get_wikis_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWikiGetWikisByCoursesResponse]:
        """Returns a list of wiki instances in a provided set of courses, if no courses are provided then all the wiki instances the user has access to will be returned.

        Returns a list of wiki instances in a provided set of courses, if no courses are provided then all the wiki instances the user has access to will be returned.

        :param courseids: Array of course ids.
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_wikis_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetWikisByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_wiki_get_wikis_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of wiki instances in a provided set of courses, if no courses are provided then all the wiki instances the user has access to will be returned.

        Returns a list of wiki instances in a provided set of courses, if no courses are provided then all the wiki instances the user has access to will be returned.

        :param courseids: Array of course ids.
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_get_wikis_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiGetWikisByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_wiki_get_wikis_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_wiki_get_wikis_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_wiki_get_wikis_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_wiki_get_wikis_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_wiki_new_page_args(
        self,
        content: Annotated[Optional[StrictStr], Field(description="Page contents.")],
        title: Annotated[Optional[StrictStr], Field(description="New page title.")],
        contentformat: Annotated[Optional[StrictStr], Field(description="Page contents format. If an invalid format is provided, default                     wiki format is used.")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Subwiki's group ID. Used if subwiki does not exists.")] = None,
        subwikiid: Annotated[Optional[StrictInt], Field(description="Page's subwiki ID.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Subwiki's user ID. Used if subwiki does not exists.")] = None,
        wikiid: Annotated[Optional[StrictInt], Field(description="Page's wiki ID. Used if subwiki does not exists.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Create a new page in a subwiki.

        Create a new page in a subwiki.

        :param content: Page contents. (required)
        :type content: str
        :param title: New page title. (required)
        :type title: str
        :param contentformat: Page contents format. If an invalid format is provided, default                     wiki format is used.
        :type contentformat: str
        :param groupid: Subwiki's group ID. Used if subwiki does not exists.
        :type groupid: int
        :param subwikiid: Page's subwiki ID.
        :type subwikiid: int
        :param userid: Subwiki's user ID. Used if subwiki does not exists.
        :type userid: int
        :param wikiid: Page's wiki ID. Used if subwiki does not exists.
        :type wikiid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_new_page_serialize(
            content=content,
            title=title,
            contentformat=contentformat,
            groupid=groupid,
            subwikiid=subwikiid,
            userid=userid,
            wikiid=wikiid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiNewPageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_wiki_new_page(
        self,
        content: Annotated[Optional[StrictStr], Field(description="Page contents.")],
        title: Annotated[Optional[StrictStr], Field(description="New page title.")],
        contentformat: Annotated[Optional[StrictStr], Field(description="Page contents format. If an invalid format is provided, default                     wiki format is used.")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Subwiki's group ID. Used if subwiki does not exists.")] = None,
        subwikiid: Annotated[Optional[StrictInt], Field(description="Page's subwiki ID.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Subwiki's user ID. Used if subwiki does not exists.")] = None,
        wikiid: Annotated[Optional[StrictInt], Field(description="Page's wiki ID. Used if subwiki does not exists.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWikiNewPageResponse:
        """Create a new page in a subwiki.

        Create a new page in a subwiki.

        :param content: Page contents. (required)
        :type content: str
        :param title: New page title. (required)
        :type title: str
        :param contentformat: Page contents format. If an invalid format is provided, default                     wiki format is used.
        :type contentformat: str
        :param groupid: Subwiki's group ID. Used if subwiki does not exists.
        :type groupid: int
        :param subwikiid: Page's subwiki ID.
        :type subwikiid: int
        :param userid: Subwiki's user ID. Used if subwiki does not exists.
        :type userid: int
        :param wikiid: Page's wiki ID. Used if subwiki does not exists.
        :type wikiid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_new_page_serialize(
            content=content,
            title=title,
            contentformat=contentformat,
            groupid=groupid,
            subwikiid=subwikiid,
            userid=userid,
            wikiid=wikiid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiNewPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_new_page_from_args(
        self,
        args
    ) -> ModWikiNewPageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiNewPageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_new_page_with_http_info(
        self,
        content: Annotated[Optional[StrictStr], Field(description="Page contents.")],
        title: Annotated[Optional[StrictStr], Field(description="New page title.")],
        contentformat: Annotated[Optional[StrictStr], Field(description="Page contents format. If an invalid format is provided, default                     wiki format is used.")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Subwiki's group ID. Used if subwiki does not exists.")] = None,
        subwikiid: Annotated[Optional[StrictInt], Field(description="Page's subwiki ID.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Subwiki's user ID. Used if subwiki does not exists.")] = None,
        wikiid: Annotated[Optional[StrictInt], Field(description="Page's wiki ID. Used if subwiki does not exists.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWikiNewPageResponse]:
        """Create a new page in a subwiki.

        Create a new page in a subwiki.

        :param content: Page contents. (required)
        :type content: str
        :param title: New page title. (required)
        :type title: str
        :param contentformat: Page contents format. If an invalid format is provided, default                     wiki format is used.
        :type contentformat: str
        :param groupid: Subwiki's group ID. Used if subwiki does not exists.
        :type groupid: int
        :param subwikiid: Page's subwiki ID.
        :type subwikiid: int
        :param userid: Subwiki's user ID. Used if subwiki does not exists.
        :type userid: int
        :param wikiid: Page's wiki ID. Used if subwiki does not exists.
        :type wikiid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_new_page_serialize(
            content=content,
            title=title,
            contentformat=contentformat,
            groupid=groupid,
            subwikiid=subwikiid,
            userid=userid,
            wikiid=wikiid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiNewPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_wiki_new_page_without_preload_content(
        self,
        content: Annotated[Optional[StrictStr], Field(description="Page contents.")],
        title: Annotated[Optional[StrictStr], Field(description="New page title.")],
        contentformat: Annotated[Optional[StrictStr], Field(description="Page contents format. If an invalid format is provided, default                     wiki format is used.")] = None,
        groupid: Annotated[Optional[StrictInt], Field(description="Subwiki's group ID. Used if subwiki does not exists.")] = None,
        subwikiid: Annotated[Optional[StrictInt], Field(description="Page's subwiki ID.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Subwiki's user ID. Used if subwiki does not exists.")] = None,
        wikiid: Annotated[Optional[StrictInt], Field(description="Page's wiki ID. Used if subwiki does not exists.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create a new page in a subwiki.

        Create a new page in a subwiki.

        :param content: Page contents. (required)
        :type content: str
        :param title: New page title. (required)
        :type title: str
        :param contentformat: Page contents format. If an invalid format is provided, default                     wiki format is used.
        :type contentformat: str
        :param groupid: Subwiki's group ID. Used if subwiki does not exists.
        :type groupid: int
        :param subwikiid: Page's subwiki ID.
        :type subwikiid: int
        :param userid: Subwiki's user ID. Used if subwiki does not exists.
        :type userid: int
        :param wikiid: Page's wiki ID. Used if subwiki does not exists.
        :type wikiid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_new_page_serialize(
            content=content,
            title=title,
            contentformat=contentformat,
            groupid=groupid,
            subwikiid=subwikiid,
            userid=userid,
            wikiid=wikiid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiNewPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_wiki_new_page_serialize(
        self,
        content,
        title,
        contentformat,
        groupid,
        subwikiid,
        userid,
        wikiid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_wiki_new_page'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_wiki_new_page'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_wiki_new_page',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if content is not None:
            _form_params += parse_form({'content': content})
        if contentformat is not None:
            _form_params += parse_form({'contentformat': contentformat})
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if subwikiid is not None:
            _form_params += parse_form({'subwikiid': subwikiid})
        if title is not None:
            _form_params += parse_form({'title': title})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        if wikiid is not None:
            _form_params += parse_form({'wikiid': wikiid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_wiki_view_page_args(
        self,
        pageid: Annotated[Optional[StrictInt], Field(description="Wiki page ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the page viewed event and update the module completion status.

        Trigger the page viewed event and update the module completion status.

        :param pageid: Wiki page ID. (required)
        :type pageid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_view_page_serialize(
            pageid=pageid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiViewPageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_wiki_view_page(
        self,
        pageid: Annotated[Optional[StrictInt], Field(description="Wiki page ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWikiViewPageResponse:
        """Trigger the page viewed event and update the module completion status.

        Trigger the page viewed event and update the module completion status.

        :param pageid: Wiki page ID. (required)
        :type pageid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_view_page_serialize(
            pageid=pageid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiViewPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_view_page_from_args(
        self,
        args
    ) -> ModWikiViewPageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiViewPageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_view_page_with_http_info(
        self,
        pageid: Annotated[Optional[StrictInt], Field(description="Wiki page ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWikiViewPageResponse]:
        """Trigger the page viewed event and update the module completion status.

        Trigger the page viewed event and update the module completion status.

        :param pageid: Wiki page ID. (required)
        :type pageid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_view_page_serialize(
            pageid=pageid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiViewPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_wiki_view_page_without_preload_content(
        self,
        pageid: Annotated[Optional[StrictInt], Field(description="Wiki page ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the page viewed event and update the module completion status.

        Trigger the page viewed event and update the module completion status.

        :param pageid: Wiki page ID. (required)
        :type pageid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_view_page_serialize(
            pageid=pageid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiViewPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_wiki_view_page_serialize(
        self,
        pageid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_wiki_view_page'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_wiki_view_page'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_wiki_view_page',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if pageid is not None:
            _form_params += parse_form({'pageid': pageid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_wiki_view_wiki_args(
        self,
        wikiid: Annotated[Optional[StrictInt], Field(description="Wiki instance ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param wikiid: Wiki instance ID. (required)
        :type wikiid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_view_wiki_serialize(
            wikiid=wikiid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiViewWikiResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_wiki_view_wiki(
        self,
        wikiid: Annotated[Optional[StrictInt], Field(description="Wiki instance ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWikiViewWikiResponse:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param wikiid: Wiki instance ID. (required)
        :type wikiid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_view_wiki_serialize(
            wikiid=wikiid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiViewWikiResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_view_wiki_from_args(
        self,
        args
    ) -> ModWikiViewWikiResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiViewWikiResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_wiki_view_wiki_with_http_info(
        self,
        wikiid: Annotated[Optional[StrictInt], Field(description="Wiki instance ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWikiViewWikiResponse]:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param wikiid: Wiki instance ID. (required)
        :type wikiid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_view_wiki_serialize(
            wikiid=wikiid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiViewWikiResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_wiki_view_wiki_without_preload_content(
        self,
        wikiid: Annotated[Optional[StrictInt], Field(description="Wiki instance ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param wikiid: Wiki instance ID. (required)
        :type wikiid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_wiki_view_wiki_serialize(
            wikiid=wikiid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWikiViewWikiResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_wiki_view_wiki_serialize(
        self,
        wikiid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_wiki_view_wiki'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_wiki_view_wiki'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_wiki_view_wiki',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if wikiid is not None:
            _form_params += parse_form({'wikiid': wikiid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_add_submission_args(
        self,
        title: Annotated[Optional[StrictStr], Field(description="Submission title")],
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop id")],
        attachmentsid: Annotated[Optional[StrictInt], Field(description="The draft file area id for attachments")] = None,
        content: Annotated[Optional[StrictStr], Field(description="Submission text content")] = None,
        contentformat: Annotated[Optional[StrictInt], Field(description="The format used for the content")] = None,
        inlineattachmentsid: Annotated[Optional[StrictInt], Field(description="The draft file area id for inline attachments in the content")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Add a new submission to a given workshop.

        Add a new submission to a given workshop.

        :param title: Submission title (required)
        :type title: str
        :param workshopid: Workshop id (required)
        :type workshopid: int
        :param attachmentsid: The draft file area id for attachments
        :type attachmentsid: int
        :param content: Submission text content
        :type content: str
        :param contentformat: The format used for the content
        :type contentformat: int
        :param inlineattachmentsid: The draft file area id for inline attachments in the content
        :type inlineattachmentsid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_add_submission_serialize(
            title=title,
            workshopid=workshopid,
            attachmentsid=attachmentsid,
            content=content,
            contentformat=contentformat,
            inlineattachmentsid=inlineattachmentsid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopAddSubmissionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_add_submission(
        self,
        title: Annotated[Optional[StrictStr], Field(description="Submission title")],
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop id")],
        attachmentsid: Annotated[Optional[StrictInt], Field(description="The draft file area id for attachments")] = None,
        content: Annotated[Optional[StrictStr], Field(description="Submission text content")] = None,
        contentformat: Annotated[Optional[StrictInt], Field(description="The format used for the content")] = None,
        inlineattachmentsid: Annotated[Optional[StrictInt], Field(description="The draft file area id for inline attachments in the content")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopAddSubmissionResponse:
        """Add a new submission to a given workshop.

        Add a new submission to a given workshop.

        :param title: Submission title (required)
        :type title: str
        :param workshopid: Workshop id (required)
        :type workshopid: int
        :param attachmentsid: The draft file area id for attachments
        :type attachmentsid: int
        :param content: Submission text content
        :type content: str
        :param contentformat: The format used for the content
        :type contentformat: int
        :param inlineattachmentsid: The draft file area id for inline attachments in the content
        :type inlineattachmentsid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_add_submission_serialize(
            title=title,
            workshopid=workshopid,
            attachmentsid=attachmentsid,
            content=content,
            contentformat=contentformat,
            inlineattachmentsid=inlineattachmentsid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopAddSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_add_submission_from_args(
        self,
        args
    ) -> ModWorkshopAddSubmissionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopAddSubmissionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_add_submission_with_http_info(
        self,
        title: Annotated[Optional[StrictStr], Field(description="Submission title")],
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop id")],
        attachmentsid: Annotated[Optional[StrictInt], Field(description="The draft file area id for attachments")] = None,
        content: Annotated[Optional[StrictStr], Field(description="Submission text content")] = None,
        contentformat: Annotated[Optional[StrictInt], Field(description="The format used for the content")] = None,
        inlineattachmentsid: Annotated[Optional[StrictInt], Field(description="The draft file area id for inline attachments in the content")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopAddSubmissionResponse]:
        """Add a new submission to a given workshop.

        Add a new submission to a given workshop.

        :param title: Submission title (required)
        :type title: str
        :param workshopid: Workshop id (required)
        :type workshopid: int
        :param attachmentsid: The draft file area id for attachments
        :type attachmentsid: int
        :param content: Submission text content
        :type content: str
        :param contentformat: The format used for the content
        :type contentformat: int
        :param inlineattachmentsid: The draft file area id for inline attachments in the content
        :type inlineattachmentsid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_add_submission_serialize(
            title=title,
            workshopid=workshopid,
            attachmentsid=attachmentsid,
            content=content,
            contentformat=contentformat,
            inlineattachmentsid=inlineattachmentsid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopAddSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_add_submission_without_preload_content(
        self,
        title: Annotated[Optional[StrictStr], Field(description="Submission title")],
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop id")],
        attachmentsid: Annotated[Optional[StrictInt], Field(description="The draft file area id for attachments")] = None,
        content: Annotated[Optional[StrictStr], Field(description="Submission text content")] = None,
        contentformat: Annotated[Optional[StrictInt], Field(description="The format used for the content")] = None,
        inlineattachmentsid: Annotated[Optional[StrictInt], Field(description="The draft file area id for inline attachments in the content")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Add a new submission to a given workshop.

        Add a new submission to a given workshop.

        :param title: Submission title (required)
        :type title: str
        :param workshopid: Workshop id (required)
        :type workshopid: int
        :param attachmentsid: The draft file area id for attachments
        :type attachmentsid: int
        :param content: Submission text content
        :type content: str
        :param contentformat: The format used for the content
        :type contentformat: int
        :param inlineattachmentsid: The draft file area id for inline attachments in the content
        :type inlineattachmentsid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_add_submission_serialize(
            title=title,
            workshopid=workshopid,
            attachmentsid=attachmentsid,
            content=content,
            contentformat=contentformat,
            inlineattachmentsid=inlineattachmentsid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopAddSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_add_submission_serialize(
        self,
        title,
        workshopid,
        attachmentsid,
        content,
        contentformat,
        inlineattachmentsid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_add_submission'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_add_submission'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_add_submission',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attachmentsid is not None:
            _form_params += parse_form({'attachmentsid': attachmentsid})
        if content is not None:
            _form_params += parse_form({'content': content})
        if contentformat is not None:
            _form_params += parse_form({'contentformat': contentformat})
        if inlineattachmentsid is not None:
            _form_params += parse_form({'inlineattachmentsid': inlineattachmentsid})
        if title is not None:
            _form_params += parse_form({'title': title})
        if workshopid is not None:
            _form_params += parse_form({'workshopid': workshopid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_delete_submission_args(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes the given submission.

        Deletes the given submission.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_delete_submission_serialize(
            submissionid=submissionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopDeleteSubmissionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_delete_submission(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopDeleteSubmissionResponse:
        """Deletes the given submission.

        Deletes the given submission.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_delete_submission_serialize(
            submissionid=submissionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopDeleteSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_delete_submission_from_args(
        self,
        args
    ) -> ModWorkshopDeleteSubmissionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopDeleteSubmissionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_delete_submission_with_http_info(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopDeleteSubmissionResponse]:
        """Deletes the given submission.

        Deletes the given submission.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_delete_submission_serialize(
            submissionid=submissionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopDeleteSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_delete_submission_without_preload_content(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes the given submission.

        Deletes the given submission.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_delete_submission_serialize(
            submissionid=submissionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopDeleteSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_delete_submission_serialize(
        self,
        submissionid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_delete_submission'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_delete_submission'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_delete_submission',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if submissionid is not None:
            _form_params += parse_form({'submissionid': submissionid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_evaluate_assessment_args(
        self,
        assessmentid: Annotated[Optional[StrictInt], Field(description="Assessment id.")],
        feedbackformat: Annotated[Optional[StrictInt], Field(description="The feedback format for text.")] = None,
        feedbacktext: Annotated[Optional[StrictStr], Field(description="The feedback for the reviewer.")] = None,
        gradinggradeover: Annotated[Optional[StrictStr], Field(description="The new grading grade.")] = None,
        weight: Annotated[Optional[StrictInt], Field(description="The new weight for the assessment.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Evaluates an assessment (used by teachers for provide feedback to the reviewer).

        Evaluates an assessment (used by teachers for provide feedback to the reviewer).

        :param assessmentid: Assessment id. (required)
        :type assessmentid: int
        :param feedbackformat: The feedback format for text.
        :type feedbackformat: int
        :param feedbacktext: The feedback for the reviewer.
        :type feedbacktext: str
        :param gradinggradeover: The new grading grade.
        :type gradinggradeover: str
        :param weight: The new weight for the assessment.
        :type weight: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_evaluate_assessment_serialize(
            assessmentid=assessmentid,
            feedbackformat=feedbackformat,
            feedbacktext=feedbacktext,
            gradinggradeover=gradinggradeover,
            weight=weight,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopEvaluateAssessmentResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_evaluate_assessment(
        self,
        assessmentid: Annotated[Optional[StrictInt], Field(description="Assessment id.")],
        feedbackformat: Annotated[Optional[StrictInt], Field(description="The feedback format for text.")] = None,
        feedbacktext: Annotated[Optional[StrictStr], Field(description="The feedback for the reviewer.")] = None,
        gradinggradeover: Annotated[Optional[StrictStr], Field(description="The new grading grade.")] = None,
        weight: Annotated[Optional[StrictInt], Field(description="The new weight for the assessment.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopEvaluateAssessmentResponse:
        """Evaluates an assessment (used by teachers for provide feedback to the reviewer).

        Evaluates an assessment (used by teachers for provide feedback to the reviewer).

        :param assessmentid: Assessment id. (required)
        :type assessmentid: int
        :param feedbackformat: The feedback format for text.
        :type feedbackformat: int
        :param feedbacktext: The feedback for the reviewer.
        :type feedbacktext: str
        :param gradinggradeover: The new grading grade.
        :type gradinggradeover: str
        :param weight: The new weight for the assessment.
        :type weight: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_evaluate_assessment_serialize(
            assessmentid=assessmentid,
            feedbackformat=feedbackformat,
            feedbacktext=feedbacktext,
            gradinggradeover=gradinggradeover,
            weight=weight,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopEvaluateAssessmentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_evaluate_assessment_from_args(
        self,
        args
    ) -> ModWorkshopEvaluateAssessmentResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopEvaluateAssessmentResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_evaluate_assessment_with_http_info(
        self,
        assessmentid: Annotated[Optional[StrictInt], Field(description="Assessment id.")],
        feedbackformat: Annotated[Optional[StrictInt], Field(description="The feedback format for text.")] = None,
        feedbacktext: Annotated[Optional[StrictStr], Field(description="The feedback for the reviewer.")] = None,
        gradinggradeover: Annotated[Optional[StrictStr], Field(description="The new grading grade.")] = None,
        weight: Annotated[Optional[StrictInt], Field(description="The new weight for the assessment.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopEvaluateAssessmentResponse]:
        """Evaluates an assessment (used by teachers for provide feedback to the reviewer).

        Evaluates an assessment (used by teachers for provide feedback to the reviewer).

        :param assessmentid: Assessment id. (required)
        :type assessmentid: int
        :param feedbackformat: The feedback format for text.
        :type feedbackformat: int
        :param feedbacktext: The feedback for the reviewer.
        :type feedbacktext: str
        :param gradinggradeover: The new grading grade.
        :type gradinggradeover: str
        :param weight: The new weight for the assessment.
        :type weight: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_evaluate_assessment_serialize(
            assessmentid=assessmentid,
            feedbackformat=feedbackformat,
            feedbacktext=feedbacktext,
            gradinggradeover=gradinggradeover,
            weight=weight,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopEvaluateAssessmentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_evaluate_assessment_without_preload_content(
        self,
        assessmentid: Annotated[Optional[StrictInt], Field(description="Assessment id.")],
        feedbackformat: Annotated[Optional[StrictInt], Field(description="The feedback format for text.")] = None,
        feedbacktext: Annotated[Optional[StrictStr], Field(description="The feedback for the reviewer.")] = None,
        gradinggradeover: Annotated[Optional[StrictStr], Field(description="The new grading grade.")] = None,
        weight: Annotated[Optional[StrictInt], Field(description="The new weight for the assessment.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Evaluates an assessment (used by teachers for provide feedback to the reviewer).

        Evaluates an assessment (used by teachers for provide feedback to the reviewer).

        :param assessmentid: Assessment id. (required)
        :type assessmentid: int
        :param feedbackformat: The feedback format for text.
        :type feedbackformat: int
        :param feedbacktext: The feedback for the reviewer.
        :type feedbacktext: str
        :param gradinggradeover: The new grading grade.
        :type gradinggradeover: str
        :param weight: The new weight for the assessment.
        :type weight: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_evaluate_assessment_serialize(
            assessmentid=assessmentid,
            feedbackformat=feedbackformat,
            feedbacktext=feedbacktext,
            gradinggradeover=gradinggradeover,
            weight=weight,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopEvaluateAssessmentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_evaluate_assessment_serialize(
        self,
        assessmentid,
        feedbackformat,
        feedbacktext,
        gradinggradeover,
        weight,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_evaluate_assessment'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_evaluate_assessment'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_evaluate_assessment',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assessmentid is not None:
            _form_params += parse_form({'assessmentid': assessmentid})
        if feedbackformat is not None:
            _form_params += parse_form({'feedbackformat': feedbackformat})
        if feedbacktext is not None:
            _form_params += parse_form({'feedbacktext': feedbacktext})
        if gradinggradeover is not None:
            _form_params += parse_form({'gradinggradeover': gradinggradeover})
        if weight is not None:
            _form_params += parse_form({'weight': weight})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_evaluate_submission_args(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="submission id.")],
        feedbackformat: Annotated[Optional[StrictInt], Field(description="The feedback format for text.")] = None,
        feedbacktext: Annotated[Optional[StrictStr], Field(description="The feedback for the author.")] = None,
        gradeover: Annotated[Optional[StrictStr], Field(description="The new submission grade.")] = None,
        published: Annotated[Optional[StrictBool], Field(description="Publish the submission for others?.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Evaluates a submission (used by teachers for provide feedback or override the submission grade).

        Evaluates a submission (used by teachers for provide feedback or override the submission grade).

        :param submissionid: submission id. (required)
        :type submissionid: int
        :param feedbackformat: The feedback format for text.
        :type feedbackformat: int
        :param feedbacktext: The feedback for the author.
        :type feedbacktext: str
        :param gradeover: The new submission grade.
        :type gradeover: str
        :param published: Publish the submission for others?.
        :type published: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_evaluate_submission_serialize(
            submissionid=submissionid,
            feedbackformat=feedbackformat,
            feedbacktext=feedbacktext,
            gradeover=gradeover,
            published=published,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopEvaluateSubmissionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_evaluate_submission(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="submission id.")],
        feedbackformat: Annotated[Optional[StrictInt], Field(description="The feedback format for text.")] = None,
        feedbacktext: Annotated[Optional[StrictStr], Field(description="The feedback for the author.")] = None,
        gradeover: Annotated[Optional[StrictStr], Field(description="The new submission grade.")] = None,
        published: Annotated[Optional[StrictBool], Field(description="Publish the submission for others?.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopEvaluateSubmissionResponse:
        """Evaluates a submission (used by teachers for provide feedback or override the submission grade).

        Evaluates a submission (used by teachers for provide feedback or override the submission grade).

        :param submissionid: submission id. (required)
        :type submissionid: int
        :param feedbackformat: The feedback format for text.
        :type feedbackformat: int
        :param feedbacktext: The feedback for the author.
        :type feedbacktext: str
        :param gradeover: The new submission grade.
        :type gradeover: str
        :param published: Publish the submission for others?.
        :type published: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_evaluate_submission_serialize(
            submissionid=submissionid,
            feedbackformat=feedbackformat,
            feedbacktext=feedbacktext,
            gradeover=gradeover,
            published=published,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopEvaluateSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_evaluate_submission_from_args(
        self,
        args
    ) -> ModWorkshopEvaluateSubmissionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopEvaluateSubmissionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_evaluate_submission_with_http_info(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="submission id.")],
        feedbackformat: Annotated[Optional[StrictInt], Field(description="The feedback format for text.")] = None,
        feedbacktext: Annotated[Optional[StrictStr], Field(description="The feedback for the author.")] = None,
        gradeover: Annotated[Optional[StrictStr], Field(description="The new submission grade.")] = None,
        published: Annotated[Optional[StrictBool], Field(description="Publish the submission for others?.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopEvaluateSubmissionResponse]:
        """Evaluates a submission (used by teachers for provide feedback or override the submission grade).

        Evaluates a submission (used by teachers for provide feedback or override the submission grade).

        :param submissionid: submission id. (required)
        :type submissionid: int
        :param feedbackformat: The feedback format for text.
        :type feedbackformat: int
        :param feedbacktext: The feedback for the author.
        :type feedbacktext: str
        :param gradeover: The new submission grade.
        :type gradeover: str
        :param published: Publish the submission for others?.
        :type published: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_evaluate_submission_serialize(
            submissionid=submissionid,
            feedbackformat=feedbackformat,
            feedbacktext=feedbacktext,
            gradeover=gradeover,
            published=published,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopEvaluateSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_evaluate_submission_without_preload_content(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="submission id.")],
        feedbackformat: Annotated[Optional[StrictInt], Field(description="The feedback format for text.")] = None,
        feedbacktext: Annotated[Optional[StrictStr], Field(description="The feedback for the author.")] = None,
        gradeover: Annotated[Optional[StrictStr], Field(description="The new submission grade.")] = None,
        published: Annotated[Optional[StrictBool], Field(description="Publish the submission for others?.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Evaluates a submission (used by teachers for provide feedback or override the submission grade).

        Evaluates a submission (used by teachers for provide feedback or override the submission grade).

        :param submissionid: submission id. (required)
        :type submissionid: int
        :param feedbackformat: The feedback format for text.
        :type feedbackformat: int
        :param feedbacktext: The feedback for the author.
        :type feedbacktext: str
        :param gradeover: The new submission grade.
        :type gradeover: str
        :param published: Publish the submission for others?.
        :type published: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_evaluate_submission_serialize(
            submissionid=submissionid,
            feedbackformat=feedbackformat,
            feedbacktext=feedbacktext,
            gradeover=gradeover,
            published=published,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopEvaluateSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_evaluate_submission_serialize(
        self,
        submissionid,
        feedbackformat,
        feedbacktext,
        gradeover,
        published,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_evaluate_submission'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_evaluate_submission'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_evaluate_submission',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if feedbackformat is not None:
            _form_params += parse_form({'feedbackformat': feedbackformat})
        if feedbacktext is not None:
            _form_params += parse_form({'feedbacktext': feedbacktext})
        if gradeover is not None:
            _form_params += parse_form({'gradeover': gradeover})
        if published is not None:
            _form_params += parse_form({'published': published})
        if submissionid is not None:
            _form_params += parse_form({'submissionid': submissionid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_get_assessment_args(
        self,
        assessmentid: Annotated[Optional[StrictInt], Field(description="Assessment id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves the given assessment.

        Retrieves the given assessment.

        :param assessmentid: Assessment id (required)
        :type assessmentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_assessment_serialize(
            assessmentid=assessmentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetAssessmentResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_get_assessment(
        self,
        assessmentid: Annotated[Optional[StrictInt], Field(description="Assessment id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopGetAssessmentResponse:
        """Retrieves the given assessment.

        Retrieves the given assessment.

        :param assessmentid: Assessment id (required)
        :type assessmentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_assessment_serialize(
            assessmentid=assessmentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetAssessmentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_assessment_from_args(
        self,
        args
    ) -> ModWorkshopGetAssessmentResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetAssessmentResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_assessment_with_http_info(
        self,
        assessmentid: Annotated[Optional[StrictInt], Field(description="Assessment id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopGetAssessmentResponse]:
        """Retrieves the given assessment.

        Retrieves the given assessment.

        :param assessmentid: Assessment id (required)
        :type assessmentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_assessment_serialize(
            assessmentid=assessmentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetAssessmentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_get_assessment_without_preload_content(
        self,
        assessmentid: Annotated[Optional[StrictInt], Field(description="Assessment id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves the given assessment.

        Retrieves the given assessment.

        :param assessmentid: Assessment id (required)
        :type assessmentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_assessment_serialize(
            assessmentid=assessmentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetAssessmentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_get_assessment_serialize(
        self,
        assessmentid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_get_assessment'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_get_assessment'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_get_assessment',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assessmentid is not None:
            _form_params += parse_form({'assessmentid': assessmentid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_get_assessment_form_definition_args(
        self,
        assessmentid: Annotated[Optional[StrictInt], Field(description="Assessment id")],
        mode: Annotated[Optional[StrictStr], Field(description="The form mode (assessment or preview)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves the assessment form definition.

        Retrieves the assessment form definition.

        :param assessmentid: Assessment id (required)
        :type assessmentid: int
        :param mode: The form mode (assessment or preview)
        :type mode: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_assessment_form_definition_serialize(
            assessmentid=assessmentid,
            mode=mode,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetAssessmentFormDefinitionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_get_assessment_form_definition(
        self,
        assessmentid: Annotated[Optional[StrictInt], Field(description="Assessment id")],
        mode: Annotated[Optional[StrictStr], Field(description="The form mode (assessment or preview)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopGetAssessmentFormDefinitionResponse:
        """Retrieves the assessment form definition.

        Retrieves the assessment form definition.

        :param assessmentid: Assessment id (required)
        :type assessmentid: int
        :param mode: The form mode (assessment or preview)
        :type mode: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_assessment_form_definition_serialize(
            assessmentid=assessmentid,
            mode=mode,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetAssessmentFormDefinitionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_assessment_form_definition_from_args(
        self,
        args
    ) -> ModWorkshopGetAssessmentFormDefinitionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetAssessmentFormDefinitionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_assessment_form_definition_with_http_info(
        self,
        assessmentid: Annotated[Optional[StrictInt], Field(description="Assessment id")],
        mode: Annotated[Optional[StrictStr], Field(description="The form mode (assessment or preview)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopGetAssessmentFormDefinitionResponse]:
        """Retrieves the assessment form definition.

        Retrieves the assessment form definition.

        :param assessmentid: Assessment id (required)
        :type assessmentid: int
        :param mode: The form mode (assessment or preview)
        :type mode: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_assessment_form_definition_serialize(
            assessmentid=assessmentid,
            mode=mode,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetAssessmentFormDefinitionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_get_assessment_form_definition_without_preload_content(
        self,
        assessmentid: Annotated[Optional[StrictInt], Field(description="Assessment id")],
        mode: Annotated[Optional[StrictStr], Field(description="The form mode (assessment or preview)")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves the assessment form definition.

        Retrieves the assessment form definition.

        :param assessmentid: Assessment id (required)
        :type assessmentid: int
        :param mode: The form mode (assessment or preview)
        :type mode: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_assessment_form_definition_serialize(
            assessmentid=assessmentid,
            mode=mode,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetAssessmentFormDefinitionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_get_assessment_form_definition_serialize(
        self,
        assessmentid,
        mode,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_get_assessment_form_definition'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_get_assessment_form_definition'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_get_assessment_form_definition',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assessmentid is not None:
            _form_params += parse_form({'assessmentid': assessmentid})
        if mode is not None:
            _form_params += parse_form({'mode': mode})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_get_grades_args(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        userid: Annotated[Optional[StrictInt], Field(description="User id (empty or 0 for current user).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the assessment and submission grade for the given user.

        Returns the assessment and submission grade for the given user.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param userid: User id (empty or 0 for current user).
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_grades_serialize(
            workshopid=workshopid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetGradesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_get_grades(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        userid: Annotated[Optional[StrictInt], Field(description="User id (empty or 0 for current user).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopGetGradesResponse:
        """Returns the assessment and submission grade for the given user.

        Returns the assessment and submission grade for the given user.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param userid: User id (empty or 0 for current user).
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_grades_serialize(
            workshopid=workshopid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetGradesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_grades_from_args(
        self,
        args
    ) -> ModWorkshopGetGradesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetGradesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_grades_with_http_info(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        userid: Annotated[Optional[StrictInt], Field(description="User id (empty or 0 for current user).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopGetGradesResponse]:
        """Returns the assessment and submission grade for the given user.

        Returns the assessment and submission grade for the given user.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param userid: User id (empty or 0 for current user).
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_grades_serialize(
            workshopid=workshopid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetGradesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_get_grades_without_preload_content(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        userid: Annotated[Optional[StrictInt], Field(description="User id (empty or 0 for current user).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the assessment and submission grade for the given user.

        Returns the assessment and submission grade for the given user.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param userid: User id (empty or 0 for current user).
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_grades_serialize(
            workshopid=workshopid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetGradesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_get_grades_serialize(
        self,
        workshopid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_get_grades'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_get_grades'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_get_grades',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        if workshopid is not None:
            _form_params += parse_form({'workshopid': workshopid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_get_grades_report_args(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page.")] = None,
        sortby: Annotated[Optional[StrictStr], Field(description="sort by this element: lastname, firstname, submissiontitle,                     submissionmodified, submissiongrade, gradinggrade.")] = None,
        sortdirection: Annotated[Optional[StrictStr], Field(description="sort direction: ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves the assessment grades report.

        Retrieves the assessment grades report.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param groupid: Group id, 0 means that the function will determine the user group.
        :type groupid: int
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page.
        :type perpage: int
        :param sortby: sort by this element: lastname, firstname, submissiontitle,                     submissionmodified, submissiongrade, gradinggrade.
        :type sortby: str
        :param sortdirection: sort direction: ASC or DESC
        :type sortdirection: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_grades_report_serialize(
            workshopid=workshopid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            sortby=sortby,
            sortdirection=sortdirection,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetGradesReportResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_get_grades_report(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page.")] = None,
        sortby: Annotated[Optional[StrictStr], Field(description="sort by this element: lastname, firstname, submissiontitle,                     submissionmodified, submissiongrade, gradinggrade.")] = None,
        sortdirection: Annotated[Optional[StrictStr], Field(description="sort direction: ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopGetGradesReportResponse:
        """Retrieves the assessment grades report.

        Retrieves the assessment grades report.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param groupid: Group id, 0 means that the function will determine the user group.
        :type groupid: int
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page.
        :type perpage: int
        :param sortby: sort by this element: lastname, firstname, submissiontitle,                     submissionmodified, submissiongrade, gradinggrade.
        :type sortby: str
        :param sortdirection: sort direction: ASC or DESC
        :type sortdirection: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_grades_report_serialize(
            workshopid=workshopid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            sortby=sortby,
            sortdirection=sortdirection,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetGradesReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_grades_report_from_args(
        self,
        args
    ) -> ModWorkshopGetGradesReportResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetGradesReportResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_grades_report_with_http_info(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page.")] = None,
        sortby: Annotated[Optional[StrictStr], Field(description="sort by this element: lastname, firstname, submissiontitle,                     submissionmodified, submissiongrade, gradinggrade.")] = None,
        sortdirection: Annotated[Optional[StrictStr], Field(description="sort direction: ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopGetGradesReportResponse]:
        """Retrieves the assessment grades report.

        Retrieves the assessment grades report.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param groupid: Group id, 0 means that the function will determine the user group.
        :type groupid: int
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page.
        :type perpage: int
        :param sortby: sort by this element: lastname, firstname, submissiontitle,                     submissionmodified, submissiongrade, gradinggrade.
        :type sortby: str
        :param sortdirection: sort direction: ASC or DESC
        :type sortdirection: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_grades_report_serialize(
            workshopid=workshopid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            sortby=sortby,
            sortdirection=sortdirection,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetGradesReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_get_grades_report_without_preload_content(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page.")] = None,
        sortby: Annotated[Optional[StrictStr], Field(description="sort by this element: lastname, firstname, submissiontitle,                     submissionmodified, submissiongrade, gradinggrade.")] = None,
        sortdirection: Annotated[Optional[StrictStr], Field(description="sort direction: ASC or DESC")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves the assessment grades report.

        Retrieves the assessment grades report.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param groupid: Group id, 0 means that the function will determine the user group.
        :type groupid: int
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page.
        :type perpage: int
        :param sortby: sort by this element: lastname, firstname, submissiontitle,                     submissionmodified, submissiongrade, gradinggrade.
        :type sortby: str
        :param sortdirection: sort direction: ASC or DESC
        :type sortdirection: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_grades_report_serialize(
            workshopid=workshopid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            sortby=sortby,
            sortdirection=sortdirection,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetGradesReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_get_grades_report_serialize(
        self,
        workshopid,
        groupid,
        page,
        perpage,
        sortby,
        sortdirection,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_get_grades_report'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_get_grades_report'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_get_grades_report',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if page is not None:
            _form_params += parse_form({'page': page})
        if perpage is not None:
            _form_params += parse_form({'perpage': perpage})
        if sortby is not None:
            _form_params += parse_form({'sortby': sortby})
        if sortdirection is not None:
            _form_params += parse_form({'sortdirection': sortdirection})
        if workshopid is not None:
            _form_params += parse_form({'workshopid': workshopid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_get_reviewer_assessments_args(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        userid: Annotated[Optional[StrictInt], Field(description="User id who did the assessment review (empty or 0 for current user).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves all the assessments reviewed by the given user.

        Retrieves all the assessments reviewed by the given user.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param userid: User id who did the assessment review (empty or 0 for current user).
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_reviewer_assessments_serialize(
            workshopid=workshopid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetReviewerAssessmentsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_get_reviewer_assessments(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        userid: Annotated[Optional[StrictInt], Field(description="User id who did the assessment review (empty or 0 for current user).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopGetReviewerAssessmentsResponse:
        """Retrieves all the assessments reviewed by the given user.

        Retrieves all the assessments reviewed by the given user.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param userid: User id who did the assessment review (empty or 0 for current user).
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_reviewer_assessments_serialize(
            workshopid=workshopid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetReviewerAssessmentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_reviewer_assessments_from_args(
        self,
        args
    ) -> ModWorkshopGetReviewerAssessmentsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetReviewerAssessmentsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_reviewer_assessments_with_http_info(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        userid: Annotated[Optional[StrictInt], Field(description="User id who did the assessment review (empty or 0 for current user).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopGetReviewerAssessmentsResponse]:
        """Retrieves all the assessments reviewed by the given user.

        Retrieves all the assessments reviewed by the given user.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param userid: User id who did the assessment review (empty or 0 for current user).
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_reviewer_assessments_serialize(
            workshopid=workshopid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetReviewerAssessmentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_get_reviewer_assessments_without_preload_content(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        userid: Annotated[Optional[StrictInt], Field(description="User id who did the assessment review (empty or 0 for current user).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves all the assessments reviewed by the given user.

        Retrieves all the assessments reviewed by the given user.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param userid: User id who did the assessment review (empty or 0 for current user).
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_reviewer_assessments_serialize(
            workshopid=workshopid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetReviewerAssessmentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_get_reviewer_assessments_serialize(
        self,
        workshopid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_get_reviewer_assessments'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_get_reviewer_assessments'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_get_reviewer_assessments',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        if workshopid is not None:
            _form_params += parse_form({'workshopid': workshopid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_get_submission_args(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves the given submission.

        Retrieves the given submission.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_submission_serialize(
            submissionid=submissionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetSubmissionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_get_submission(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopGetSubmissionResponse:
        """Retrieves the given submission.

        Retrieves the given submission.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_submission_serialize(
            submissionid=submissionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_submission_from_args(
        self,
        args
    ) -> ModWorkshopGetSubmissionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetSubmissionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_submission_with_http_info(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopGetSubmissionResponse]:
        """Retrieves the given submission.

        Retrieves the given submission.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_submission_serialize(
            submissionid=submissionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_get_submission_without_preload_content(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves the given submission.

        Retrieves the given submission.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_submission_serialize(
            submissionid=submissionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_get_submission_serialize(
        self,
        submissionid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_get_submission'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_get_submission'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_get_submission',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if submissionid is not None:
            _form_params += parse_form({'submissionid': submissionid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_get_submission_assessments_args(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves all the assessments of the given submission.

        Retrieves all the assessments of the given submission.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_submission_assessments_serialize(
            submissionid=submissionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetSubmissionAssessmentsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_get_submission_assessments(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopGetSubmissionAssessmentsResponse:
        """Retrieves all the assessments of the given submission.

        Retrieves all the assessments of the given submission.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_submission_assessments_serialize(
            submissionid=submissionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetSubmissionAssessmentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_submission_assessments_from_args(
        self,
        args
    ) -> ModWorkshopGetSubmissionAssessmentsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetSubmissionAssessmentsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_submission_assessments_with_http_info(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopGetSubmissionAssessmentsResponse]:
        """Retrieves all the assessments of the given submission.

        Retrieves all the assessments of the given submission.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_submission_assessments_serialize(
            submissionid=submissionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetSubmissionAssessmentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_get_submission_assessments_without_preload_content(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves all the assessments of the given submission.

        Retrieves all the assessments of the given submission.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_submission_assessments_serialize(
            submissionid=submissionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetSubmissionAssessmentsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_get_submission_assessments_serialize(
        self,
        submissionid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_get_submission_assessments'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_get_submission_assessments'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_get_submission_assessments',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if submissionid is not None:
            _form_params += parse_form({'submissionid': submissionid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_get_submissions_args(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group.                                                    It will return submissions done by users in the given group.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Get submissions done by this user. Use 0 or empty for the current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieves all the workshop submissions or the one done by the given user (except example submissions).

        Retrieves all the workshop submissions or the one done by the given user (except example submissions).

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param groupid: Group id, 0 means that the function will determine the user group.                                                    It will return submissions done by users in the given group.
        :type groupid: int
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page.
        :type perpage: int
        :param userid: Get submissions done by this user. Use 0 or empty for the current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_submissions_serialize(
            workshopid=workshopid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetSubmissionsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_get_submissions(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group.                                                    It will return submissions done by users in the given group.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Get submissions done by this user. Use 0 or empty for the current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopGetSubmissionsResponse:
        """Retrieves all the workshop submissions or the one done by the given user (except example submissions).

        Retrieves all the workshop submissions or the one done by the given user (except example submissions).

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param groupid: Group id, 0 means that the function will determine the user group.                                                    It will return submissions done by users in the given group.
        :type groupid: int
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page.
        :type perpage: int
        :param userid: Get submissions done by this user. Use 0 or empty for the current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_submissions_serialize(
            workshopid=workshopid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetSubmissionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_submissions_from_args(
        self,
        args
    ) -> ModWorkshopGetSubmissionsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetSubmissionsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_submissions_with_http_info(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group.                                                    It will return submissions done by users in the given group.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Get submissions done by this user. Use 0 or empty for the current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopGetSubmissionsResponse]:
        """Retrieves all the workshop submissions or the one done by the given user (except example submissions).

        Retrieves all the workshop submissions or the one done by the given user (except example submissions).

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param groupid: Group id, 0 means that the function will determine the user group.                                                    It will return submissions done by users in the given group.
        :type groupid: int
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page.
        :type perpage: int
        :param userid: Get submissions done by this user. Use 0 or empty for the current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_submissions_serialize(
            workshopid=workshopid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetSubmissionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_get_submissions_without_preload_content(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        groupid: Annotated[Optional[StrictInt], Field(description="Group id, 0 means that the function will determine the user group.                                                    It will return submissions done by users in the given group.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="The page of records to return.")] = None,
        perpage: Annotated[Optional[StrictInt], Field(description="The number of records to return per page.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="Get submissions done by this user. Use 0 or empty for the current user")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieves all the workshop submissions or the one done by the given user (except example submissions).

        Retrieves all the workshop submissions or the one done by the given user (except example submissions).

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param groupid: Group id, 0 means that the function will determine the user group.                                                    It will return submissions done by users in the given group.
        :type groupid: int
        :param page: The page of records to return.
        :type page: int
        :param perpage: The number of records to return per page.
        :type perpage: int
        :param userid: Get submissions done by this user. Use 0 or empty for the current user
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_submissions_serialize(
            workshopid=workshopid,
            groupid=groupid,
            page=page,
            perpage=perpage,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetSubmissionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_get_submissions_serialize(
        self,
        workshopid,
        groupid,
        page,
        perpage,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_get_submissions'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_get_submissions'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_get_submissions',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if groupid is not None:
            _form_params += parse_form({'groupid': groupid})
        if page is not None:
            _form_params += parse_form({'page': page})
        if perpage is not None:
            _form_params += parse_form({'perpage': perpage})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        if workshopid is not None:
            _form_params += parse_form({'workshopid': workshopid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_get_user_plan_args(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        userid: Annotated[Optional[StrictInt], Field(description="User id (empty or 0 for current user).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return the planner information for the given user.

        Return the planner information for the given user.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param userid: User id (empty or 0 for current user).
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_user_plan_serialize(
            workshopid=workshopid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetUserPlanResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_get_user_plan(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        userid: Annotated[Optional[StrictInt], Field(description="User id (empty or 0 for current user).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopGetUserPlanResponse:
        """Return the planner information for the given user.

        Return the planner information for the given user.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param userid: User id (empty or 0 for current user).
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_user_plan_serialize(
            workshopid=workshopid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetUserPlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_user_plan_from_args(
        self,
        args
    ) -> ModWorkshopGetUserPlanResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetUserPlanResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_user_plan_with_http_info(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        userid: Annotated[Optional[StrictInt], Field(description="User id (empty or 0 for current user).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopGetUserPlanResponse]:
        """Return the planner information for the given user.

        Return the planner information for the given user.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param userid: User id (empty or 0 for current user).
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_user_plan_serialize(
            workshopid=workshopid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetUserPlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_get_user_plan_without_preload_content(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        userid: Annotated[Optional[StrictInt], Field(description="User id (empty or 0 for current user).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return the planner information for the given user.

        Return the planner information for the given user.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param userid: User id (empty or 0 for current user).
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_user_plan_serialize(
            workshopid=workshopid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetUserPlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_get_user_plan_serialize(
        self,
        workshopid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_get_user_plan'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_get_user_plan'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_get_user_plan',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        if workshopid is not None:
            _form_params += parse_form({'workshopid': workshopid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_get_workshop_access_information_args(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return access information for a given workshop.

        Return access information for a given workshop.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_workshop_access_information_serialize(
            workshopid=workshopid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetWorkshopAccessInformationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_get_workshop_access_information(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopGetWorkshopAccessInformationResponse:
        """Return access information for a given workshop.

        Return access information for a given workshop.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_workshop_access_information_serialize(
            workshopid=workshopid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetWorkshopAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_workshop_access_information_from_args(
        self,
        args
    ) -> ModWorkshopGetWorkshopAccessInformationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetWorkshopAccessInformationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_workshop_access_information_with_http_info(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopGetWorkshopAccessInformationResponse]:
        """Return access information for a given workshop.

        Return access information for a given workshop.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_workshop_access_information_serialize(
            workshopid=workshopid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetWorkshopAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_get_workshop_access_information_without_preload_content(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return access information for a given workshop.

        Return access information for a given workshop.

        :param workshopid: Workshop instance id. (required)
        :type workshopid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_workshop_access_information_serialize(
            workshopid=workshopid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetWorkshopAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_get_workshop_access_information_serialize(
        self,
        workshopid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_get_workshop_access_information'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_get_workshop_access_information'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_get_workshop_access_information',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if workshopid is not None:
            _form_params += parse_form({'workshopid': workshopid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_get_workshops_by_courses_args(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of workshops in a provided list of courses, if no list is provided all workshops that                             the user can view will be returned.

        Returns a list of workshops in a provided list of courses, if no list is provided all workshops that                             the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_workshops_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetWorkshopsByCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_get_workshops_by_courses(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopGetWorkshopsByCoursesResponse:
        """Returns a list of workshops in a provided list of courses, if no list is provided all workshops that                             the user can view will be returned.

        Returns a list of workshops in a provided list of courses, if no list is provided all workshops that                             the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_workshops_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetWorkshopsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_workshops_by_courses_from_args(
        self,
        args
    ) -> ModWorkshopGetWorkshopsByCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetWorkshopsByCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_get_workshops_by_courses_with_http_info(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopGetWorkshopsByCoursesResponse]:
        """Returns a list of workshops in a provided list of courses, if no list is provided all workshops that                             the user can view will be returned.

        Returns a list of workshops in a provided list of courses, if no list is provided all workshops that                             the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_workshops_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetWorkshopsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_get_workshops_by_courses_without_preload_content(
        self,
        courseids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of course ids")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of workshops in a provided list of courses, if no list is provided all workshops that                             the user can view will be returned.

        Returns a list of workshops in a provided list of courses, if no list is provided all workshops that                             the user can view will be returned.

        :param courseids: Array of course ids
        :type courseids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_get_workshops_by_courses_serialize(
            courseids=courseids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopGetWorkshopsByCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_get_workshops_by_courses_serialize(
        self,
        courseids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'courseids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_get_workshops_by_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_get_workshops_by_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_get_workshops_by_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseids is not None:
            _form_params += parse_form({'courseids': courseids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_update_assessment_args(
        self,
        assessmentid: Annotated[Optional[StrictInt], Field(description="Assessment id.")],
        data: Annotated[List[ModWorkshopUpdateAssessmentParametersDataInner], Field(description="Assessment data")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Add information to an allocated assessment.

        Add information to an allocated assessment.

        :param assessmentid: Assessment id. (required)
        :type assessmentid: int
        :param data: Assessment data (required)
        :type data: List[ModWorkshopUpdateAssessmentParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_update_assessment_serialize(
            assessmentid=assessmentid,
            data=data,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopUpdateAssessmentResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_update_assessment(
        self,
        assessmentid: Annotated[Optional[StrictInt], Field(description="Assessment id.")],
        data: Annotated[List[ModWorkshopUpdateAssessmentParametersDataInner], Field(description="Assessment data")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopUpdateAssessmentResponse:
        """Add information to an allocated assessment.

        Add information to an allocated assessment.

        :param assessmentid: Assessment id. (required)
        :type assessmentid: int
        :param data: Assessment data (required)
        :type data: List[ModWorkshopUpdateAssessmentParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_update_assessment_serialize(
            assessmentid=assessmentid,
            data=data,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopUpdateAssessmentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_update_assessment_from_args(
        self,
        args
    ) -> ModWorkshopUpdateAssessmentResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopUpdateAssessmentResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_update_assessment_with_http_info(
        self,
        assessmentid: Annotated[Optional[StrictInt], Field(description="Assessment id.")],
        data: Annotated[List[ModWorkshopUpdateAssessmentParametersDataInner], Field(description="Assessment data")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopUpdateAssessmentResponse]:
        """Add information to an allocated assessment.

        Add information to an allocated assessment.

        :param assessmentid: Assessment id. (required)
        :type assessmentid: int
        :param data: Assessment data (required)
        :type data: List[ModWorkshopUpdateAssessmentParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_update_assessment_serialize(
            assessmentid=assessmentid,
            data=data,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopUpdateAssessmentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_update_assessment_without_preload_content(
        self,
        assessmentid: Annotated[Optional[StrictInt], Field(description="Assessment id.")],
        data: Annotated[List[ModWorkshopUpdateAssessmentParametersDataInner], Field(description="Assessment data")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Add information to an allocated assessment.

        Add information to an allocated assessment.

        :param assessmentid: Assessment id. (required)
        :type assessmentid: int
        :param data: Assessment data (required)
        :type data: List[ModWorkshopUpdateAssessmentParametersDataInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_update_assessment_serialize(
            assessmentid=assessmentid,
            data=data,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopUpdateAssessmentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_update_assessment_serialize(
        self,
        assessmentid,
        data,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'data': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_update_assessment'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_update_assessment'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_update_assessment',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if assessmentid is not None:
            _form_params += parse_form({'assessmentid': assessmentid})
        if data is not None:
            _form_params += parse_form({'data': data})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_update_submission_args(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        title: Annotated[Optional[StrictStr], Field(description="Submission title")],
        attachmentsid: Annotated[Optional[StrictInt], Field(description="The draft file area id for attachments")] = None,
        content: Annotated[Optional[StrictStr], Field(description="Submission text content")] = None,
        contentformat: Annotated[Optional[StrictInt], Field(description="The format used for the content")] = None,
        inlineattachmentsid: Annotated[Optional[StrictInt], Field(description="The draft file area id for inline attachments in the content")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update the given submission.

        Update the given submission.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param title: Submission title (required)
        :type title: str
        :param attachmentsid: The draft file area id for attachments
        :type attachmentsid: int
        :param content: Submission text content
        :type content: str
        :param contentformat: The format used for the content
        :type contentformat: int
        :param inlineattachmentsid: The draft file area id for inline attachments in the content
        :type inlineattachmentsid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_update_submission_serialize(
            submissionid=submissionid,
            title=title,
            attachmentsid=attachmentsid,
            content=content,
            contentformat=contentformat,
            inlineattachmentsid=inlineattachmentsid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopUpdateSubmissionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_update_submission(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        title: Annotated[Optional[StrictStr], Field(description="Submission title")],
        attachmentsid: Annotated[Optional[StrictInt], Field(description="The draft file area id for attachments")] = None,
        content: Annotated[Optional[StrictStr], Field(description="Submission text content")] = None,
        contentformat: Annotated[Optional[StrictInt], Field(description="The format used for the content")] = None,
        inlineattachmentsid: Annotated[Optional[StrictInt], Field(description="The draft file area id for inline attachments in the content")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopUpdateSubmissionResponse:
        """Update the given submission.

        Update the given submission.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param title: Submission title (required)
        :type title: str
        :param attachmentsid: The draft file area id for attachments
        :type attachmentsid: int
        :param content: Submission text content
        :type content: str
        :param contentformat: The format used for the content
        :type contentformat: int
        :param inlineattachmentsid: The draft file area id for inline attachments in the content
        :type inlineattachmentsid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_update_submission_serialize(
            submissionid=submissionid,
            title=title,
            attachmentsid=attachmentsid,
            content=content,
            contentformat=contentformat,
            inlineattachmentsid=inlineattachmentsid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopUpdateSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_update_submission_from_args(
        self,
        args
    ) -> ModWorkshopUpdateSubmissionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopUpdateSubmissionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_update_submission_with_http_info(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        title: Annotated[Optional[StrictStr], Field(description="Submission title")],
        attachmentsid: Annotated[Optional[StrictInt], Field(description="The draft file area id for attachments")] = None,
        content: Annotated[Optional[StrictStr], Field(description="Submission text content")] = None,
        contentformat: Annotated[Optional[StrictInt], Field(description="The format used for the content")] = None,
        inlineattachmentsid: Annotated[Optional[StrictInt], Field(description="The draft file area id for inline attachments in the content")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopUpdateSubmissionResponse]:
        """Update the given submission.

        Update the given submission.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param title: Submission title (required)
        :type title: str
        :param attachmentsid: The draft file area id for attachments
        :type attachmentsid: int
        :param content: Submission text content
        :type content: str
        :param contentformat: The format used for the content
        :type contentformat: int
        :param inlineattachmentsid: The draft file area id for inline attachments in the content
        :type inlineattachmentsid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_update_submission_serialize(
            submissionid=submissionid,
            title=title,
            attachmentsid=attachmentsid,
            content=content,
            contentformat=contentformat,
            inlineattachmentsid=inlineattachmentsid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopUpdateSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_update_submission_without_preload_content(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        title: Annotated[Optional[StrictStr], Field(description="Submission title")],
        attachmentsid: Annotated[Optional[StrictInt], Field(description="The draft file area id for attachments")] = None,
        content: Annotated[Optional[StrictStr], Field(description="Submission text content")] = None,
        contentformat: Annotated[Optional[StrictInt], Field(description="The format used for the content")] = None,
        inlineattachmentsid: Annotated[Optional[StrictInt], Field(description="The draft file area id for inline attachments in the content")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update the given submission.

        Update the given submission.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param title: Submission title (required)
        :type title: str
        :param attachmentsid: The draft file area id for attachments
        :type attachmentsid: int
        :param content: Submission text content
        :type content: str
        :param contentformat: The format used for the content
        :type contentformat: int
        :param inlineattachmentsid: The draft file area id for inline attachments in the content
        :type inlineattachmentsid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_update_submission_serialize(
            submissionid=submissionid,
            title=title,
            attachmentsid=attachmentsid,
            content=content,
            contentformat=contentformat,
            inlineattachmentsid=inlineattachmentsid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopUpdateSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_update_submission_serialize(
        self,
        submissionid,
        title,
        attachmentsid,
        content,
        contentformat,
        inlineattachmentsid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_update_submission'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_update_submission'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_update_submission',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if attachmentsid is not None:
            _form_params += parse_form({'attachmentsid': attachmentsid})
        if content is not None:
            _form_params += parse_form({'content': content})
        if contentformat is not None:
            _form_params += parse_form({'contentformat': contentformat})
        if inlineattachmentsid is not None:
            _form_params += parse_form({'inlineattachmentsid': inlineattachmentsid})
        if submissionid is not None:
            _form_params += parse_form({'submissionid': submissionid})
        if title is not None:
            _form_params += parse_form({'title': title})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_view_submission_args(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the submission viewed event.

        Trigger the submission viewed event.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_view_submission_serialize(
            submissionid=submissionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopViewSubmissionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_view_submission(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopViewSubmissionResponse:
        """Trigger the submission viewed event.

        Trigger the submission viewed event.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_view_submission_serialize(
            submissionid=submissionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopViewSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_view_submission_from_args(
        self,
        args
    ) -> ModWorkshopViewSubmissionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopViewSubmissionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_view_submission_with_http_info(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopViewSubmissionResponse]:
        """Trigger the submission viewed event.

        Trigger the submission viewed event.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_view_submission_serialize(
            submissionid=submissionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopViewSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_view_submission_without_preload_content(
        self,
        submissionid: Annotated[Optional[StrictInt], Field(description="Submission id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the submission viewed event.

        Trigger the submission viewed event.

        :param submissionid: Submission id (required)
        :type submissionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_view_submission_serialize(
            submissionid=submissionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopViewSubmissionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_view_submission_serialize(
        self,
        submissionid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_view_submission'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_view_submission'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_view_submission',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if submissionid is not None:
            _form_params += parse_form({'submissionid': submissionid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def mod_workshop_view_workshop_args(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param workshopid: Workshop instance id (required)
        :type workshopid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_view_workshop_serialize(
            workshopid=workshopid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopViewWorkshopResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def mod_workshop_view_workshop(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ModWorkshopViewWorkshopResponse:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param workshopid: Workshop instance id (required)
        :type workshopid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_view_workshop_serialize(
            workshopid=workshopid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopViewWorkshopResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_view_workshop_from_args(
        self,
        args
    ) -> ModWorkshopViewWorkshopResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopViewWorkshopResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def mod_workshop_view_workshop_with_http_info(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ModWorkshopViewWorkshopResponse]:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param workshopid: Workshop instance id (required)
        :type workshopid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_view_workshop_serialize(
            workshopid=workshopid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopViewWorkshopResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def mod_workshop_view_workshop_without_preload_content(
        self,
        workshopid: Annotated[Optional[StrictInt], Field(description="Workshop instance id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Trigger the course module viewed event and update the module completion status.

        Trigger the course module viewed event and update the module completion status.

        :param workshopid: Workshop instance id (required)
        :type workshopid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._mod_workshop_view_workshop_serialize(
            workshopid=workshopid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ModWorkshopViewWorkshopResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _mod_workshop_view_workshop_serialize(
        self,
        workshopid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#mod_workshop_view_workshop'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'mod_workshop_view_workshop'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'mod_workshop_view_workshop',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if workshopid is not None:
            _form_params += parse_form({'workshopid': workshopid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def paygw_paypal_create_transaction_complete_args(
        self,
        args: PaygwPaypalCreateTransactionCompleteParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Takes care of what needs to be done when a PayPal transaction comes back as complete.

        Takes care of what needs to be done when a PayPal transaction comes back as complete.

        :param args: (required)
        :type args: PaygwPaypalCreateTransactionCompleteParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._paygw_paypal_create_transaction_complete_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaygwPaypalCreateTransactionCompleteResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def paygw_paypal_create_transaction_complete(
        self,
        args: PaygwPaypalCreateTransactionCompleteParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PaygwPaypalCreateTransactionCompleteResponse:
        """Takes care of what needs to be done when a PayPal transaction comes back as complete.

        Takes care of what needs to be done when a PayPal transaction comes back as complete.

        :param args: (required)
        :type args: PaygwPaypalCreateTransactionCompleteParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._paygw_paypal_create_transaction_complete_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaygwPaypalCreateTransactionCompleteResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def paygw_paypal_create_transaction_complete_from_args(
        self,
        args
    ) -> PaygwPaypalCreateTransactionCompleteResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaygwPaypalCreateTransactionCompleteResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def paygw_paypal_create_transaction_complete_with_http_info(
        self,
        args: PaygwPaypalCreateTransactionCompleteParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PaygwPaypalCreateTransactionCompleteResponse]:
        """Takes care of what needs to be done when a PayPal transaction comes back as complete.

        Takes care of what needs to be done when a PayPal transaction comes back as complete.

        :param args: (required)
        :type args: PaygwPaypalCreateTransactionCompleteParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._paygw_paypal_create_transaction_complete_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaygwPaypalCreateTransactionCompleteResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def paygw_paypal_create_transaction_complete_without_preload_content(
        self,
        args: PaygwPaypalCreateTransactionCompleteParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Takes care of what needs to be done when a PayPal transaction comes back as complete.

        Takes care of what needs to be done when a PayPal transaction comes back as complete.

        :param args: (required)
        :type args: PaygwPaypalCreateTransactionCompleteParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._paygw_paypal_create_transaction_complete_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaygwPaypalCreateTransactionCompleteResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _paygw_paypal_create_transaction_complete_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#paygw_paypal_create_transaction_complete'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'paygw_paypal_create_transaction_complete'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'paygw_paypal_create_transaction_complete',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def paygw_paypal_get_config_for_js_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component")],
        itemid: Annotated[Optional[StrictInt], Field(description="An identifier for payment area in the component")],
        paymentarea: Annotated[Optional[StrictStr], Field(description="Payment area in the component")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns the configuration settings to be used in js

        Returns the configuration settings to be used in js

        :param component: Component (required)
        :type component: str
        :param itemid: An identifier for payment area in the component (required)
        :type itemid: int
        :param paymentarea: Payment area in the component (required)
        :type paymentarea: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._paygw_paypal_get_config_for_js_serialize(
            component=component,
            itemid=itemid,
            paymentarea=paymentarea,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaygwPaypalGetConfigForJsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def paygw_paypal_get_config_for_js(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component")],
        itemid: Annotated[Optional[StrictInt], Field(description="An identifier for payment area in the component")],
        paymentarea: Annotated[Optional[StrictStr], Field(description="Payment area in the component")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PaygwPaypalGetConfigForJsResponse:
        """Returns the configuration settings to be used in js

        Returns the configuration settings to be used in js

        :param component: Component (required)
        :type component: str
        :param itemid: An identifier for payment area in the component (required)
        :type itemid: int
        :param paymentarea: Payment area in the component (required)
        :type paymentarea: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._paygw_paypal_get_config_for_js_serialize(
            component=component,
            itemid=itemid,
            paymentarea=paymentarea,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaygwPaypalGetConfigForJsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def paygw_paypal_get_config_for_js_from_args(
        self,
        args
    ) -> PaygwPaypalGetConfigForJsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaygwPaypalGetConfigForJsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def paygw_paypal_get_config_for_js_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component")],
        itemid: Annotated[Optional[StrictInt], Field(description="An identifier for payment area in the component")],
        paymentarea: Annotated[Optional[StrictStr], Field(description="Payment area in the component")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PaygwPaypalGetConfigForJsResponse]:
        """Returns the configuration settings to be used in js

        Returns the configuration settings to be used in js

        :param component: Component (required)
        :type component: str
        :param itemid: An identifier for payment area in the component (required)
        :type itemid: int
        :param paymentarea: Payment area in the component (required)
        :type paymentarea: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._paygw_paypal_get_config_for_js_serialize(
            component=component,
            itemid=itemid,
            paymentarea=paymentarea,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaygwPaypalGetConfigForJsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def paygw_paypal_get_config_for_js_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component")],
        itemid: Annotated[Optional[StrictInt], Field(description="An identifier for payment area in the component")],
        paymentarea: Annotated[Optional[StrictStr], Field(description="Payment area in the component")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns the configuration settings to be used in js

        Returns the configuration settings to be used in js

        :param component: Component (required)
        :type component: str
        :param itemid: An identifier for payment area in the component (required)
        :type itemid: int
        :param paymentarea: Payment area in the component (required)
        :type paymentarea: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._paygw_paypal_get_config_for_js_serialize(
            component=component,
            itemid=itemid,
            paymentarea=paymentarea,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PaygwPaypalGetConfigForJsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _paygw_paypal_get_config_for_js_serialize(
        self,
        component,
        itemid,
        paymentarea,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#paygw_paypal_get_config_for_js'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'paygw_paypal_get_config_for_js'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'paygw_paypal_get_config_for_js',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if component is not None:
            _form_params += parse_form({'component': component})
        if itemid is not None:
            _form_params += parse_form({'itemid': itemid})
        if paymentarea is not None:
            _form_params += parse_form({'paymentarea': paymentarea})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def qbank_columnsortorder_set_column_size_args(
        self,
        var_global: Annotated[Optional[StrictBool], Field(description="Set global config setting, rather than user preference")] = None,
        sizes: Annotated[Optional[StrictStr], Field(description="Size for each column, as a JSON string representing [column => size]")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Column size

        Column size

        :param var_global: Set global config setting, rather than user preference
        :type var_global: bool
        :param sizes: Size for each column, as a JSON string representing [column => size]
        :type sizes: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_columnsortorder_set_column_size_serialize(
            var_global=var_global,
            sizes=sizes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def qbank_columnsortorder_set_column_size(
        self,
        var_global: Annotated[Optional[StrictBool], Field(description="Set global config setting, rather than user preference")] = None,
        sizes: Annotated[Optional[StrictStr], Field(description="Size for each column, as a JSON string representing [column => size]")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Column size

        Column size

        :param var_global: Set global config setting, rather than user preference
        :type var_global: bool
        :param sizes: Size for each column, as a JSON string representing [column => size]
        :type sizes: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_columnsortorder_set_column_size_serialize(
            var_global=var_global,
            sizes=sizes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def qbank_columnsortorder_set_column_size_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def qbank_columnsortorder_set_column_size_with_http_info(
        self,
        var_global: Annotated[Optional[StrictBool], Field(description="Set global config setting, rather than user preference")] = None,
        sizes: Annotated[Optional[StrictStr], Field(description="Size for each column, as a JSON string representing [column => size]")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Column size

        Column size

        :param var_global: Set global config setting, rather than user preference
        :type var_global: bool
        :param sizes: Size for each column, as a JSON string representing [column => size]
        :type sizes: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_columnsortorder_set_column_size_serialize(
            var_global=var_global,
            sizes=sizes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def qbank_columnsortorder_set_column_size_without_preload_content(
        self,
        var_global: Annotated[Optional[StrictBool], Field(description="Set global config setting, rather than user preference")] = None,
        sizes: Annotated[Optional[StrictStr], Field(description="Size for each column, as a JSON string representing [column => size]")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Column size

        Column size

        :param var_global: Set global config setting, rather than user preference
        :type var_global: bool
        :param sizes: Size for each column, as a JSON string representing [column => size]
        :type sizes: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_columnsortorder_set_column_size_serialize(
            var_global=var_global,
            sizes=sizes,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _qbank_columnsortorder_set_column_size_serialize(
        self,
        var_global,
        sizes,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#qbank_columnsortorder_set_column_size'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'qbank_columnsortorder_set_column_size'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'qbank_columnsortorder_set_column_size',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if var_global is not None:
            _form_params += parse_form({'global': var_global})
        if sizes is not None:
            _form_params += parse_form({'sizes': sizes})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def qbank_columnsortorder_set_columnbank_order_args(
        self,
        columns: Annotated[Optional[List[Optional[StrictStr]]], Field(description="List of column in the desired order")] = None,
        var_global: Annotated[Optional[StrictBool], Field(description="Set global config setting, rather than user preference")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Sets question columns order in database

        Sets question columns order in database

        :param columns: List of column in the desired order
        :type columns: List[Optional[str]]
        :param var_global: Set global config setting, rather than user preference
        :type var_global: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_columnsortorder_set_columnbank_order_serialize(
            columns=columns,
            var_global=var_global,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def qbank_columnsortorder_set_columnbank_order(
        self,
        columns: Annotated[Optional[List[Optional[StrictStr]]], Field(description="List of column in the desired order")] = None,
        var_global: Annotated[Optional[StrictBool], Field(description="Set global config setting, rather than user preference")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Sets question columns order in database

        Sets question columns order in database

        :param columns: List of column in the desired order
        :type columns: List[Optional[str]]
        :param var_global: Set global config setting, rather than user preference
        :type var_global: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_columnsortorder_set_columnbank_order_serialize(
            columns=columns,
            var_global=var_global,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def qbank_columnsortorder_set_columnbank_order_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def qbank_columnsortorder_set_columnbank_order_with_http_info(
        self,
        columns: Annotated[Optional[List[Optional[StrictStr]]], Field(description="List of column in the desired order")] = None,
        var_global: Annotated[Optional[StrictBool], Field(description="Set global config setting, rather than user preference")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Sets question columns order in database

        Sets question columns order in database

        :param columns: List of column in the desired order
        :type columns: List[Optional[str]]
        :param var_global: Set global config setting, rather than user preference
        :type var_global: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_columnsortorder_set_columnbank_order_serialize(
            columns=columns,
            var_global=var_global,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def qbank_columnsortorder_set_columnbank_order_without_preload_content(
        self,
        columns: Annotated[Optional[List[Optional[StrictStr]]], Field(description="List of column in the desired order")] = None,
        var_global: Annotated[Optional[StrictBool], Field(description="Set global config setting, rather than user preference")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Sets question columns order in database

        Sets question columns order in database

        :param columns: List of column in the desired order
        :type columns: List[Optional[str]]
        :param var_global: Set global config setting, rather than user preference
        :type var_global: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_columnsortorder_set_columnbank_order_serialize(
            columns=columns,
            var_global=var_global,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _qbank_columnsortorder_set_columnbank_order_serialize(
        self,
        columns,
        var_global,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'columns': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#qbank_columnsortorder_set_columnbank_order'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'qbank_columnsortorder_set_columnbank_order'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'qbank_columnsortorder_set_columnbank_order',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if columns is not None:
            _form_params += parse_form({'columns': columns})
        if var_global is not None:
            _form_params += parse_form({'global': var_global})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def qbank_columnsortorder_set_hidden_columns_args(
        self,
        columns: Annotated[Optional[List[Optional[StrictStr]]], Field(description="List of hidden columns")] = None,
        var_global: Annotated[Optional[StrictBool], Field(description="Set global config setting, rather than user preference")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Hidden Columns

        Hidden Columns

        :param columns: List of hidden columns
        :type columns: List[Optional[str]]
        :param var_global: Set global config setting, rather than user preference
        :type var_global: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_columnsortorder_set_hidden_columns_serialize(
            columns=columns,
            var_global=var_global,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def qbank_columnsortorder_set_hidden_columns(
        self,
        columns: Annotated[Optional[List[Optional[StrictStr]]], Field(description="List of hidden columns")] = None,
        var_global: Annotated[Optional[StrictBool], Field(description="Set global config setting, rather than user preference")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Hidden Columns

        Hidden Columns

        :param columns: List of hidden columns
        :type columns: List[Optional[str]]
        :param var_global: Set global config setting, rather than user preference
        :type var_global: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_columnsortorder_set_hidden_columns_serialize(
            columns=columns,
            var_global=var_global,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def qbank_columnsortorder_set_hidden_columns_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def qbank_columnsortorder_set_hidden_columns_with_http_info(
        self,
        columns: Annotated[Optional[List[Optional[StrictStr]]], Field(description="List of hidden columns")] = None,
        var_global: Annotated[Optional[StrictBool], Field(description="Set global config setting, rather than user preference")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Hidden Columns

        Hidden Columns

        :param columns: List of hidden columns
        :type columns: List[Optional[str]]
        :param var_global: Set global config setting, rather than user preference
        :type var_global: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_columnsortorder_set_hidden_columns_serialize(
            columns=columns,
            var_global=var_global,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def qbank_columnsortorder_set_hidden_columns_without_preload_content(
        self,
        columns: Annotated[Optional[List[Optional[StrictStr]]], Field(description="List of hidden columns")] = None,
        var_global: Annotated[Optional[StrictBool], Field(description="Set global config setting, rather than user preference")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Hidden Columns

        Hidden Columns

        :param columns: List of hidden columns
        :type columns: List[Optional[str]]
        :param var_global: Set global config setting, rather than user preference
        :type var_global: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_columnsortorder_set_hidden_columns_serialize(
            columns=columns,
            var_global=var_global,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _qbank_columnsortorder_set_hidden_columns_serialize(
        self,
        columns,
        var_global,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'columns': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#qbank_columnsortorder_set_hidden_columns'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'qbank_columnsortorder_set_hidden_columns'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'qbank_columnsortorder_set_hidden_columns',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if columns is not None:
            _form_params += parse_form({'columns': columns})
        if var_global is not None:
            _form_params += parse_form({'global': var_global})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def qbank_editquestion_set_status_args(
        self,
        questionid: Annotated[Optional[StrictInt], Field(description="The question id")],
        status: Annotated[Optional[StrictStr], Field(description="The updated question status")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update the question status.

        Update the question status.

        :param questionid: The question id (required)
        :type questionid: int
        :param status: The updated question status (required)
        :type status: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_editquestion_set_status_serialize(
            questionid=questionid,
            status=status,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QbankEditquestionSetStatusResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def qbank_editquestion_set_status(
        self,
        questionid: Annotated[Optional[StrictInt], Field(description="The question id")],
        status: Annotated[Optional[StrictStr], Field(description="The updated question status")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> QbankEditquestionSetStatusResponse:
        """Update the question status.

        Update the question status.

        :param questionid: The question id (required)
        :type questionid: int
        :param status: The updated question status (required)
        :type status: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_editquestion_set_status_serialize(
            questionid=questionid,
            status=status,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QbankEditquestionSetStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def qbank_editquestion_set_status_from_args(
        self,
        args
    ) -> QbankEditquestionSetStatusResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QbankEditquestionSetStatusResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def qbank_editquestion_set_status_with_http_info(
        self,
        questionid: Annotated[Optional[StrictInt], Field(description="The question id")],
        status: Annotated[Optional[StrictStr], Field(description="The updated question status")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[QbankEditquestionSetStatusResponse]:
        """Update the question status.

        Update the question status.

        :param questionid: The question id (required)
        :type questionid: int
        :param status: The updated question status (required)
        :type status: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_editquestion_set_status_serialize(
            questionid=questionid,
            status=status,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QbankEditquestionSetStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def qbank_editquestion_set_status_without_preload_content(
        self,
        questionid: Annotated[Optional[StrictInt], Field(description="The question id")],
        status: Annotated[Optional[StrictStr], Field(description="The updated question status")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update the question status.

        Update the question status.

        :param questionid: The question id (required)
        :type questionid: int
        :param status: The updated question status (required)
        :type status: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_editquestion_set_status_serialize(
            questionid=questionid,
            status=status,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QbankEditquestionSetStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _qbank_editquestion_set_status_serialize(
        self,
        questionid,
        status,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#qbank_editquestion_set_status'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'qbank_editquestion_set_status'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'qbank_editquestion_set_status',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if questionid is not None:
            _form_params += parse_form({'questionid': questionid})
        if status is not None:
            _form_params += parse_form({'status': status})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def qbank_managecategories_move_category_args(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="Category being moved")],
        pagecontextid: Annotated[Optional[StrictInt], Field(description="The context of the current page")],
        precedingsiblingid: Annotated[Optional[StrictInt], Field(description="The ID of the preceding category. Null if this is being moved to top of its parent")],
        targetparentid: Annotated[Optional[StrictInt], Field(description="The ID of the parent category to move to.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Move a question category

        Move a question category

        :param categoryid: Category being moved (required)
        :type categoryid: int
        :param pagecontextid: The context of the current page (required)
        :type pagecontextid: int
        :param precedingsiblingid: The ID of the preceding category. Null if this is being moved to top of its parent (required)
        :type precedingsiblingid: int
        :param targetparentid: The ID of the parent category to move to. (required)
        :type targetparentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_managecategories_move_category_serialize(
            categoryid=categoryid,
            pagecontextid=pagecontextid,
            precedingsiblingid=precedingsiblingid,
            targetparentid=targetparentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[QbankManagecategoriesMoveCategoryResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def qbank_managecategories_move_category(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="Category being moved")],
        pagecontextid: Annotated[Optional[StrictInt], Field(description="The context of the current page")],
        precedingsiblingid: Annotated[Optional[StrictInt], Field(description="The ID of the preceding category. Null if this is being moved to top of its parent")],
        targetparentid: Annotated[Optional[StrictInt], Field(description="The ID of the parent category to move to.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[QbankManagecategoriesMoveCategoryResponseInner]:
        """Move a question category

        Move a question category

        :param categoryid: Category being moved (required)
        :type categoryid: int
        :param pagecontextid: The context of the current page (required)
        :type pagecontextid: int
        :param precedingsiblingid: The ID of the preceding category. Null if this is being moved to top of its parent (required)
        :type precedingsiblingid: int
        :param targetparentid: The ID of the parent category to move to. (required)
        :type targetparentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_managecategories_move_category_serialize(
            categoryid=categoryid,
            pagecontextid=pagecontextid,
            precedingsiblingid=precedingsiblingid,
            targetparentid=targetparentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[QbankManagecategoriesMoveCategoryResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def qbank_managecategories_move_category_from_args(
        self,
        args
    ) -> List[QbankManagecategoriesMoveCategoryResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[QbankManagecategoriesMoveCategoryResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def qbank_managecategories_move_category_with_http_info(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="Category being moved")],
        pagecontextid: Annotated[Optional[StrictInt], Field(description="The context of the current page")],
        precedingsiblingid: Annotated[Optional[StrictInt], Field(description="The ID of the preceding category. Null if this is being moved to top of its parent")],
        targetparentid: Annotated[Optional[StrictInt], Field(description="The ID of the parent category to move to.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[QbankManagecategoriesMoveCategoryResponseInner]]:
        """Move a question category

        Move a question category

        :param categoryid: Category being moved (required)
        :type categoryid: int
        :param pagecontextid: The context of the current page (required)
        :type pagecontextid: int
        :param precedingsiblingid: The ID of the preceding category. Null if this is being moved to top of its parent (required)
        :type precedingsiblingid: int
        :param targetparentid: The ID of the parent category to move to. (required)
        :type targetparentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_managecategories_move_category_serialize(
            categoryid=categoryid,
            pagecontextid=pagecontextid,
            precedingsiblingid=precedingsiblingid,
            targetparentid=targetparentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[QbankManagecategoriesMoveCategoryResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def qbank_managecategories_move_category_without_preload_content(
        self,
        categoryid: Annotated[Optional[StrictInt], Field(description="Category being moved")],
        pagecontextid: Annotated[Optional[StrictInt], Field(description="The context of the current page")],
        precedingsiblingid: Annotated[Optional[StrictInt], Field(description="The ID of the preceding category. Null if this is being moved to top of its parent")],
        targetparentid: Annotated[Optional[StrictInt], Field(description="The ID of the parent category to move to.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Move a question category

        Move a question category

        :param categoryid: Category being moved (required)
        :type categoryid: int
        :param pagecontextid: The context of the current page (required)
        :type pagecontextid: int
        :param precedingsiblingid: The ID of the preceding category. Null if this is being moved to top of its parent (required)
        :type precedingsiblingid: int
        :param targetparentid: The ID of the parent category to move to. (required)
        :type targetparentid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_managecategories_move_category_serialize(
            categoryid=categoryid,
            pagecontextid=pagecontextid,
            precedingsiblingid=precedingsiblingid,
            targetparentid=targetparentid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[QbankManagecategoriesMoveCategoryResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _qbank_managecategories_move_category_serialize(
        self,
        categoryid,
        pagecontextid,
        precedingsiblingid,
        targetparentid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#qbank_managecategories_move_category'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'qbank_managecategories_move_category'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'qbank_managecategories_move_category',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if categoryid is not None:
            _form_params += parse_form({'categoryid': categoryid})
        if pagecontextid is not None:
            _form_params += parse_form({'pagecontextid': pagecontextid})
        if precedingsiblingid is not None:
            _form_params += parse_form({'precedingsiblingid': precedingsiblingid})
        if targetparentid is not None:
            _form_params += parse_form({'targetparentid': targetparentid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def qbank_tagquestion_submit_tags_form_args(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The editing context id")],
        formdata: Annotated[Optional[StrictStr], Field(description="The data from the tag form")],
        questionid: Annotated[Optional[StrictInt], Field(description="The question id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update the question tags.

        Update the question tags.

        :param contextid: The editing context id (required)
        :type contextid: int
        :param formdata: The data from the tag form (required)
        :type formdata: str
        :param questionid: The question id (required)
        :type questionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_tagquestion_submit_tags_form_serialize(
            contextid=contextid,
            formdata=formdata,
            questionid=questionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QbankTagquestionSubmitTagsFormResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def qbank_tagquestion_submit_tags_form(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The editing context id")],
        formdata: Annotated[Optional[StrictStr], Field(description="The data from the tag form")],
        questionid: Annotated[Optional[StrictInt], Field(description="The question id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> QbankTagquestionSubmitTagsFormResponse:
        """Update the question tags.

        Update the question tags.

        :param contextid: The editing context id (required)
        :type contextid: int
        :param formdata: The data from the tag form (required)
        :type formdata: str
        :param questionid: The question id (required)
        :type questionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_tagquestion_submit_tags_form_serialize(
            contextid=contextid,
            formdata=formdata,
            questionid=questionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QbankTagquestionSubmitTagsFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def qbank_tagquestion_submit_tags_form_from_args(
        self,
        args
    ) -> QbankTagquestionSubmitTagsFormResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QbankTagquestionSubmitTagsFormResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def qbank_tagquestion_submit_tags_form_with_http_info(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The editing context id")],
        formdata: Annotated[Optional[StrictStr], Field(description="The data from the tag form")],
        questionid: Annotated[Optional[StrictInt], Field(description="The question id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[QbankTagquestionSubmitTagsFormResponse]:
        """Update the question tags.

        Update the question tags.

        :param contextid: The editing context id (required)
        :type contextid: int
        :param formdata: The data from the tag form (required)
        :type formdata: str
        :param questionid: The question id (required)
        :type questionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_tagquestion_submit_tags_form_serialize(
            contextid=contextid,
            formdata=formdata,
            questionid=questionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QbankTagquestionSubmitTagsFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def qbank_tagquestion_submit_tags_form_without_preload_content(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The editing context id")],
        formdata: Annotated[Optional[StrictStr], Field(description="The data from the tag form")],
        questionid: Annotated[Optional[StrictInt], Field(description="The question id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update the question tags.

        Update the question tags.

        :param contextid: The editing context id (required)
        :type contextid: int
        :param formdata: The data from the tag form (required)
        :type formdata: str
        :param questionid: The question id (required)
        :type questionid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_tagquestion_submit_tags_form_serialize(
            contextid=contextid,
            formdata=formdata,
            questionid=questionid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QbankTagquestionSubmitTagsFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _qbank_tagquestion_submit_tags_form_serialize(
        self,
        contextid,
        formdata,
        questionid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#qbank_tagquestion_submit_tags_form'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'qbank_tagquestion_submit_tags_form'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'qbank_tagquestion_submit_tags_form',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if formdata is not None:
            _form_params += parse_form({'formdata': formdata})
        if questionid is not None:
            _form_params += parse_form({'questionid': questionid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def qbank_viewquestiontext_set_question_text_format_args(
        self,
        format: Annotated[Optional[StrictInt], Field(description="Format for the question text")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Sets the preference for displaying and formatting the question text

        Sets the preference for displaying and formatting the question text

        :param format: Format for the question text (required)
        :type format: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_viewquestiontext_set_question_text_format_serialize(
            format=format,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def qbank_viewquestiontext_set_question_text_format(
        self,
        format: Annotated[Optional[StrictInt], Field(description="Format for the question text")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Sets the preference for displaying and formatting the question text

        Sets the preference for displaying and formatting the question text

        :param format: Format for the question text (required)
        :type format: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_viewquestiontext_set_question_text_format_serialize(
            format=format,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def qbank_viewquestiontext_set_question_text_format_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def qbank_viewquestiontext_set_question_text_format_with_http_info(
        self,
        format: Annotated[Optional[StrictInt], Field(description="Format for the question text")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Sets the preference for displaying and formatting the question text

        Sets the preference for displaying and formatting the question text

        :param format: Format for the question text (required)
        :type format: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_viewquestiontext_set_question_text_format_serialize(
            format=format,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def qbank_viewquestiontext_set_question_text_format_without_preload_content(
        self,
        format: Annotated[Optional[StrictInt], Field(description="Format for the question text")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Sets the preference for displaying and formatting the question text

        Sets the preference for displaying and formatting the question text

        :param format: Format for the question text (required)
        :type format: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._qbank_viewquestiontext_set_question_text_format_serialize(
            format=format,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _qbank_viewquestiontext_set_question_text_format_serialize(
        self,
        format,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#qbank_viewquestiontext_set_question_text_format'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'qbank_viewquestiontext_set_question_text_format'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'qbank_viewquestiontext_set_question_text_format',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if format is not None:
            _form_params += parse_form({'format': format})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def quizaccess_seb_validate_quiz_keys_args(
        self,
        cmid: Annotated[StrictInt, Field(description="Course module ID")],
        url: Annotated[StrictStr, Field(description="Page URL to check")],
        browserexamkey: Annotated[Optional[StrictStr], Field(description="SEB browser exam key")] = None,
        configkey: Annotated[Optional[StrictStr], Field(description="SEB config key")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Validate a Safe Exam Browser config key or a browser exam key.

        Validate a Safe Exam Browser config key or a browser exam key.

        :param cmid: Course module ID (required)
        :type cmid: int
        :param url: Page URL to check (required)
        :type url: str
        :param browserexamkey: SEB browser exam key
        :type browserexamkey: str
        :param configkey: SEB config key
        :type configkey: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._quizaccess_seb_validate_quiz_keys_serialize(
            cmid=cmid,
            url=url,
            browserexamkey=browserexamkey,
            configkey=configkey,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QuizaccessSebValidateQuizKeysResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def quizaccess_seb_validate_quiz_keys(
        self,
        cmid: Annotated[StrictInt, Field(description="Course module ID")],
        url: Annotated[StrictStr, Field(description="Page URL to check")],
        browserexamkey: Annotated[Optional[StrictStr], Field(description="SEB browser exam key")] = None,
        configkey: Annotated[Optional[StrictStr], Field(description="SEB config key")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> QuizaccessSebValidateQuizKeysResponse:
        """Validate a Safe Exam Browser config key or a browser exam key.

        Validate a Safe Exam Browser config key or a browser exam key.

        :param cmid: Course module ID (required)
        :type cmid: int
        :param url: Page URL to check (required)
        :type url: str
        :param browserexamkey: SEB browser exam key
        :type browserexamkey: str
        :param configkey: SEB config key
        :type configkey: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._quizaccess_seb_validate_quiz_keys_serialize(
            cmid=cmid,
            url=url,
            browserexamkey=browserexamkey,
            configkey=configkey,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QuizaccessSebValidateQuizKeysResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def quizaccess_seb_validate_quiz_keys_from_args(
        self,
        args
    ) -> QuizaccessSebValidateQuizKeysResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QuizaccessSebValidateQuizKeysResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def quizaccess_seb_validate_quiz_keys_with_http_info(
        self,
        cmid: Annotated[StrictInt, Field(description="Course module ID")],
        url: Annotated[StrictStr, Field(description="Page URL to check")],
        browserexamkey: Annotated[Optional[StrictStr], Field(description="SEB browser exam key")] = None,
        configkey: Annotated[Optional[StrictStr], Field(description="SEB config key")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[QuizaccessSebValidateQuizKeysResponse]:
        """Validate a Safe Exam Browser config key or a browser exam key.

        Validate a Safe Exam Browser config key or a browser exam key.

        :param cmid: Course module ID (required)
        :type cmid: int
        :param url: Page URL to check (required)
        :type url: str
        :param browserexamkey: SEB browser exam key
        :type browserexamkey: str
        :param configkey: SEB config key
        :type configkey: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._quizaccess_seb_validate_quiz_keys_serialize(
            cmid=cmid,
            url=url,
            browserexamkey=browserexamkey,
            configkey=configkey,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QuizaccessSebValidateQuizKeysResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def quizaccess_seb_validate_quiz_keys_without_preload_content(
        self,
        cmid: Annotated[StrictInt, Field(description="Course module ID")],
        url: Annotated[StrictStr, Field(description="Page URL to check")],
        browserexamkey: Annotated[Optional[StrictStr], Field(description="SEB browser exam key")] = None,
        configkey: Annotated[Optional[StrictStr], Field(description="SEB config key")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Validate a Safe Exam Browser config key or a browser exam key.

        Validate a Safe Exam Browser config key or a browser exam key.

        :param cmid: Course module ID (required)
        :type cmid: int
        :param url: Page URL to check (required)
        :type url: str
        :param browserexamkey: SEB browser exam key
        :type browserexamkey: str
        :param configkey: SEB config key
        :type configkey: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._quizaccess_seb_validate_quiz_keys_serialize(
            cmid=cmid,
            url=url,
            browserexamkey=browserexamkey,
            configkey=configkey,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QuizaccessSebValidateQuizKeysResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _quizaccess_seb_validate_quiz_keys_serialize(
        self,
        cmid,
        url,
        browserexamkey,
        configkey,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#quizaccess_seb_validate_quiz_keys'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'quizaccess_seb_validate_quiz_keys'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'quizaccess_seb_validate_quiz_keys',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if browserexamkey is not None:
            _form_params += parse_form({'browserexamkey': browserexamkey})
        if cmid is not None:
            _form_params += parse_form({'cmid': cmid})
        if configkey is not None:
            _form_params += parse_form({'configkey': configkey})
        if url is not None:
            _form_params += parse_form({'url': url})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def report_competency_data_for_report_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        moduleid: Annotated[Optional[StrictInt], Field(description="The module id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load the data for the competency report in a course.

        Load the data for the competency report in a course.

        :param courseid: The course id (required)
        :type courseid: int
        :param moduleid: The module id (required)
        :type moduleid: int
        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._report_competency_data_for_report_serialize(
            courseid=courseid,
            moduleid=moduleid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ReportCompetencyDataForReportResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def report_competency_data_for_report(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        moduleid: Annotated[Optional[StrictInt], Field(description="The module id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ReportCompetencyDataForReportResponse:
        """Load the data for the competency report in a course.

        Load the data for the competency report in a course.

        :param courseid: The course id (required)
        :type courseid: int
        :param moduleid: The module id (required)
        :type moduleid: int
        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._report_competency_data_for_report_serialize(
            courseid=courseid,
            moduleid=moduleid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ReportCompetencyDataForReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def report_competency_data_for_report_from_args(
        self,
        args
    ) -> ReportCompetencyDataForReportResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ReportCompetencyDataForReportResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def report_competency_data_for_report_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        moduleid: Annotated[Optional[StrictInt], Field(description="The module id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ReportCompetencyDataForReportResponse]:
        """Load the data for the competency report in a course.

        Load the data for the competency report in a course.

        :param courseid: The course id (required)
        :type courseid: int
        :param moduleid: The module id (required)
        :type moduleid: int
        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._report_competency_data_for_report_serialize(
            courseid=courseid,
            moduleid=moduleid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ReportCompetencyDataForReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def report_competency_data_for_report_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        moduleid: Annotated[Optional[StrictInt], Field(description="The module id")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load the data for the competency report in a course.

        Load the data for the competency report in a course.

        :param courseid: The course id (required)
        :type courseid: int
        :param moduleid: The module id (required)
        :type moduleid: int
        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._report_competency_data_for_report_serialize(
            courseid=courseid,
            moduleid=moduleid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ReportCompetencyDataForReportResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _report_competency_data_for_report_serialize(
        self,
        courseid,
        moduleid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#report_competency_data_for_report'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'report_competency_data_for_report'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'report_competency_data_for_report',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if moduleid is not None:
            _form_params += parse_form({'moduleid': moduleid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def report_insights_action_executed_args(
        self,
        actionname: Annotated[Optional[StrictStr], Field(description="The name of the action")],
        predictionids: Annotated[List[Optional[StrictInt]], Field(description="Array of prediction ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Stores an action executed over a group of predictions.

        Stores an action executed over a group of predictions.

        :param actionname: The name of the action (required)
        :type actionname: str
        :param predictionids: Array of prediction ids (required)
        :type predictionids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._report_insights_action_executed_serialize(
            actionname=actionname,
            predictionids=predictionids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ReportInsightsActionExecutedResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def report_insights_action_executed(
        self,
        actionname: Annotated[Optional[StrictStr], Field(description="The name of the action")],
        predictionids: Annotated[List[Optional[StrictInt]], Field(description="Array of prediction ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ReportInsightsActionExecutedResponse:
        """Stores an action executed over a group of predictions.

        Stores an action executed over a group of predictions.

        :param actionname: The name of the action (required)
        :type actionname: str
        :param predictionids: Array of prediction ids (required)
        :type predictionids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._report_insights_action_executed_serialize(
            actionname=actionname,
            predictionids=predictionids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ReportInsightsActionExecutedResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def report_insights_action_executed_from_args(
        self,
        args
    ) -> ReportInsightsActionExecutedResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ReportInsightsActionExecutedResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def report_insights_action_executed_with_http_info(
        self,
        actionname: Annotated[Optional[StrictStr], Field(description="The name of the action")],
        predictionids: Annotated[List[Optional[StrictInt]], Field(description="Array of prediction ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ReportInsightsActionExecutedResponse]:
        """Stores an action executed over a group of predictions.

        Stores an action executed over a group of predictions.

        :param actionname: The name of the action (required)
        :type actionname: str
        :param predictionids: Array of prediction ids (required)
        :type predictionids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._report_insights_action_executed_serialize(
            actionname=actionname,
            predictionids=predictionids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ReportInsightsActionExecutedResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def report_insights_action_executed_without_preload_content(
        self,
        actionname: Annotated[Optional[StrictStr], Field(description="The name of the action")],
        predictionids: Annotated[List[Optional[StrictInt]], Field(description="Array of prediction ids")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Stores an action executed over a group of predictions.

        Stores an action executed over a group of predictions.

        :param actionname: The name of the action (required)
        :type actionname: str
        :param predictionids: Array of prediction ids (required)
        :type predictionids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._report_insights_action_executed_serialize(
            actionname=actionname,
            predictionids=predictionids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ReportInsightsActionExecutedResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _report_insights_action_executed_serialize(
        self,
        actionname,
        predictionids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'predictionids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#report_insights_action_executed'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'report_insights_action_executed'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'report_insights_action_executed',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if actionname is not None:
            _form_params += parse_form({'actionname': actionname})
        if predictionids is not None:
            _form_params += parse_form({'predictionids': predictionids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tiny_autosave_reset_session_args(
        self,
        args: TinyAutosaveResetSessionParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Reset an autosave session

        Reset an autosave session

        :param args: (required)
        :type args: TinyAutosaveResetSessionParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_autosave_reset_session_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tiny_autosave_reset_session(
        self,
        args: TinyAutosaveResetSessionParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Reset an autosave session

        Reset an autosave session

        :param args: (required)
        :type args: TinyAutosaveResetSessionParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_autosave_reset_session_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tiny_autosave_reset_session_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tiny_autosave_reset_session_with_http_info(
        self,
        args: TinyAutosaveResetSessionParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Reset an autosave session

        Reset an autosave session

        :param args: (required)
        :type args: TinyAutosaveResetSessionParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_autosave_reset_session_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tiny_autosave_reset_session_without_preload_content(
        self,
        args: TinyAutosaveResetSessionParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Reset an autosave session

        Reset an autosave session

        :param args: (required)
        :type args: TinyAutosaveResetSessionParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_autosave_reset_session_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tiny_autosave_reset_session_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#tiny_autosave_reset_session'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tiny_autosave_reset_session'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tiny_autosave_reset_session',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tiny_autosave_resume_session_args(
        self,
        args: TinyAutosaveResumeSessionParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Resume an autosave session

        Resume an autosave session

        :param args: (required)
        :type args: TinyAutosaveResumeSessionParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_autosave_resume_session_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyAutosaveResumeSessionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tiny_autosave_resume_session(
        self,
        args: TinyAutosaveResumeSessionParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> TinyAutosaveResumeSessionResponse:
        """Resume an autosave session

        Resume an autosave session

        :param args: (required)
        :type args: TinyAutosaveResumeSessionParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_autosave_resume_session_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyAutosaveResumeSessionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tiny_autosave_resume_session_from_args(
        self,
        args
    ) -> TinyAutosaveResumeSessionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyAutosaveResumeSessionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tiny_autosave_resume_session_with_http_info(
        self,
        args: TinyAutosaveResumeSessionParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[TinyAutosaveResumeSessionResponse]:
        """Resume an autosave session

        Resume an autosave session

        :param args: (required)
        :type args: TinyAutosaveResumeSessionParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_autosave_resume_session_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyAutosaveResumeSessionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tiny_autosave_resume_session_without_preload_content(
        self,
        args: TinyAutosaveResumeSessionParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Resume an autosave session

        Resume an autosave session

        :param args: (required)
        :type args: TinyAutosaveResumeSessionParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_autosave_resume_session_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyAutosaveResumeSessionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tiny_autosave_resume_session_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#tiny_autosave_resume_session'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tiny_autosave_resume_session'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tiny_autosave_resume_session',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tiny_autosave_update_session_args(
        self,
        args: TinyAutosaveUpdateSessionParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Update an autosave session

        Update an autosave session

        :param args: (required)
        :type args: TinyAutosaveUpdateSessionParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_autosave_update_session_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tiny_autosave_update_session(
        self,
        args: TinyAutosaveUpdateSessionParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Update an autosave session

        Update an autosave session

        :param args: (required)
        :type args: TinyAutosaveUpdateSessionParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_autosave_update_session_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tiny_autosave_update_session_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tiny_autosave_update_session_with_http_info(
        self,
        args: TinyAutosaveUpdateSessionParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Update an autosave session

        Update an autosave session

        :param args: (required)
        :type args: TinyAutosaveUpdateSessionParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_autosave_update_session_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tiny_autosave_update_session_without_preload_content(
        self,
        args: TinyAutosaveUpdateSessionParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update an autosave session

        Update an autosave session

        :param args: (required)
        :type args: TinyAutosaveUpdateSessionParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_autosave_update_session_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tiny_autosave_update_session_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#tiny_autosave_update_session'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tiny_autosave_update_session'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tiny_autosave_update_session',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tiny_equation_filter_args(
        self,
        content: Annotated[Optional[StrictStr], Field(description="The equation content")],
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Filter the equation

        Filter the equation

        :param content: The equation content (required)
        :type content: str
        :param contextid: The context ID (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_equation_filter_serialize(
            content=content,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyEquationFilterResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tiny_equation_filter(
        self,
        content: Annotated[Optional[StrictStr], Field(description="The equation content")],
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> TinyEquationFilterResponse:
        """Filter the equation

        Filter the equation

        :param content: The equation content (required)
        :type content: str
        :param contextid: The context ID (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_equation_filter_serialize(
            content=content,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyEquationFilterResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tiny_equation_filter_from_args(
        self,
        args
    ) -> TinyEquationFilterResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyEquationFilterResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tiny_equation_filter_with_http_info(
        self,
        content: Annotated[Optional[StrictStr], Field(description="The equation content")],
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[TinyEquationFilterResponse]:
        """Filter the equation

        Filter the equation

        :param content: The equation content (required)
        :type content: str
        :param contextid: The context ID (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_equation_filter_serialize(
            content=content,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyEquationFilterResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tiny_equation_filter_without_preload_content(
        self,
        content: Annotated[Optional[StrictStr], Field(description="The equation content")],
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Filter the equation

        Filter the equation

        :param content: The equation content (required)
        :type content: str
        :param contextid: The context ID (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_equation_filter_serialize(
            content=content,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyEquationFilterResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tiny_equation_filter_serialize(
        self,
        content,
        contextid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tiny_equation_filter'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tiny_equation_filter'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tiny_equation_filter',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if content is not None:
            _form_params += parse_form({'content': content})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tiny_media_preview_args(
        self,
        content: Annotated[Optional[StrictStr], Field(description="The media content")],
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Filters the content

        Filters the content

        :param content: The media content (required)
        :type content: str
        :param contextid: The context ID (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_media_preview_serialize(
            content=content,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyMediaPreviewResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tiny_media_preview(
        self,
        content: Annotated[Optional[StrictStr], Field(description="The media content")],
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> TinyMediaPreviewResponse:
        """Filters the content

        Filters the content

        :param content: The media content (required)
        :type content: str
        :param contextid: The context ID (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_media_preview_serialize(
            content=content,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyMediaPreviewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tiny_media_preview_from_args(
        self,
        args
    ) -> TinyMediaPreviewResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyMediaPreviewResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tiny_media_preview_with_http_info(
        self,
        content: Annotated[Optional[StrictStr], Field(description="The media content")],
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[TinyMediaPreviewResponse]:
        """Filters the content

        Filters the content

        :param content: The media content (required)
        :type content: str
        :param contextid: The context ID (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_media_preview_serialize(
            content=content,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyMediaPreviewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tiny_media_preview_without_preload_content(
        self,
        content: Annotated[Optional[StrictStr], Field(description="The media content")],
        contextid: Annotated[Optional[StrictInt], Field(description="The context ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Filters the content

        Filters the content

        :param content: The media content (required)
        :type content: str
        :param contextid: The context ID (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_media_preview_serialize(
            content=content,
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyMediaPreviewResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tiny_media_preview_serialize(
        self,
        content,
        contextid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tiny_media_preview'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tiny_media_preview'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tiny_media_preview',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if content is not None:
            _form_params += parse_form({'content': content})
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tiny_premium_get_api_key_args(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The current context ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the Tiny Premium API key from Moodle

        Get the Tiny Premium API key from Moodle

        :param contextid: The current context ID. (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_premium_get_api_key_serialize(
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyPremiumGetApiKeyResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tiny_premium_get_api_key(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The current context ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> TinyPremiumGetApiKeyResponse:
        """Get the Tiny Premium API key from Moodle

        Get the Tiny Premium API key from Moodle

        :param contextid: The current context ID. (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_premium_get_api_key_serialize(
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyPremiumGetApiKeyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tiny_premium_get_api_key_from_args(
        self,
        args
    ) -> TinyPremiumGetApiKeyResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyPremiumGetApiKeyResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tiny_premium_get_api_key_with_http_info(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The current context ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[TinyPremiumGetApiKeyResponse]:
        """Get the Tiny Premium API key from Moodle

        Get the Tiny Premium API key from Moodle

        :param contextid: The current context ID. (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_premium_get_api_key_serialize(
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyPremiumGetApiKeyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tiny_premium_get_api_key_without_preload_content(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The current context ID.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the Tiny Premium API key from Moodle

        Get the Tiny Premium API key from Moodle

        :param contextid: The current context ID. (required)
        :type contextid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tiny_premium_get_api_key_serialize(
            contextid=contextid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TinyPremiumGetApiKeyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tiny_premium_get_api_key_serialize(
        self,
        contextid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tiny_premium_get_api_key'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tiny_premium_get_api_key'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tiny_premium_get_api_key',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_admin_presets_delete_preset_args(
        self,
        id: Optional[StrictInt],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Delete a custom preset

        Delete a custom preset

        :param id: (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_admin_presets_delete_preset_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_admin_presets_delete_preset(
        self,
        id: Optional[StrictInt],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Delete a custom preset

        Delete a custom preset

        :param id: (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_admin_presets_delete_preset_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_admin_presets_delete_preset_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_admin_presets_delete_preset_with_http_info(
        self,
        id: Optional[StrictInt],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Delete a custom preset

        Delete a custom preset

        :param id: (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_admin_presets_delete_preset_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_admin_presets_delete_preset_without_preload_content(
        self,
        id: Optional[StrictInt],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete a custom preset

        Delete a custom preset

        :param id: (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_admin_presets_delete_preset_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_admin_presets_delete_preset_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_admin_presets_delete_preset'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_admin_presets_delete_preset'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_admin_presets_delete_preset',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_analytics_potential_contexts_args(
        self,
        modelid: Annotated[Optional[StrictInt], Field(description="The model id")] = None,
        query: Annotated[Optional[StrictStr], Field(description="The model id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieve the list of potential contexts for a model.

        Retrieve the list of potential contexts for a model.

        :param modelid: The model id
        :type modelid: int
        :param query: The model id
        :type query: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_analytics_potential_contexts_serialize(
            modelid=modelid,
            query=query,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ToolAnalyticsPotentialContextsResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_analytics_potential_contexts(
        self,
        modelid: Annotated[Optional[StrictInt], Field(description="The model id")] = None,
        query: Annotated[Optional[StrictStr], Field(description="The model id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[ToolAnalyticsPotentialContextsResponseInner]:
        """Retrieve the list of potential contexts for a model.

        Retrieve the list of potential contexts for a model.

        :param modelid: The model id
        :type modelid: int
        :param query: The model id
        :type query: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_analytics_potential_contexts_serialize(
            modelid=modelid,
            query=query,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ToolAnalyticsPotentialContextsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_analytics_potential_contexts_from_args(
        self,
        args
    ) -> List[ToolAnalyticsPotentialContextsResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ToolAnalyticsPotentialContextsResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_analytics_potential_contexts_with_http_info(
        self,
        modelid: Annotated[Optional[StrictInt], Field(description="The model id")] = None,
        query: Annotated[Optional[StrictStr], Field(description="The model id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[ToolAnalyticsPotentialContextsResponseInner]]:
        """Retrieve the list of potential contexts for a model.

        Retrieve the list of potential contexts for a model.

        :param modelid: The model id
        :type modelid: int
        :param query: The model id
        :type query: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_analytics_potential_contexts_serialize(
            modelid=modelid,
            query=query,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ToolAnalyticsPotentialContextsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_analytics_potential_contexts_without_preload_content(
        self,
        modelid: Annotated[Optional[StrictInt], Field(description="The model id")] = None,
        query: Annotated[Optional[StrictStr], Field(description="The model id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve the list of potential contexts for a model.

        Retrieve the list of potential contexts for a model.

        :param modelid: The model id
        :type modelid: int
        :param query: The model id
        :type query: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_analytics_potential_contexts_serialize(
            modelid=modelid,
            query=query,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[ToolAnalyticsPotentialContextsResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_analytics_potential_contexts_serialize(
        self,
        modelid,
        query,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_analytics_potential_contexts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_analytics_potential_contexts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_analytics_potential_contexts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if modelid is not None:
            _form_params += parse_form({'modelid': modelid})
        if query is not None:
            _form_params += parse_form({'query': query})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_behat_get_entity_generator_args(
        self,
        entitytype: Annotated[Optional[StrictStr], Field(description="Entity type that can be created by a generator.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get the generator details for an entity

        Get the generator details for an entity

        :param entitytype: Entity type that can be created by a generator. (required)
        :type entitytype: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_behat_get_entity_generator_serialize(
            entitytype=entitytype,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolBehatGetEntityGeneratorResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_behat_get_entity_generator(
        self,
        entitytype: Annotated[Optional[StrictStr], Field(description="Entity type that can be created by a generator.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolBehatGetEntityGeneratorResponse:
        """Get the generator details for an entity

        Get the generator details for an entity

        :param entitytype: Entity type that can be created by a generator. (required)
        :type entitytype: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_behat_get_entity_generator_serialize(
            entitytype=entitytype,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolBehatGetEntityGeneratorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_behat_get_entity_generator_from_args(
        self,
        args
    ) -> ToolBehatGetEntityGeneratorResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolBehatGetEntityGeneratorResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_behat_get_entity_generator_with_http_info(
        self,
        entitytype: Annotated[Optional[StrictStr], Field(description="Entity type that can be created by a generator.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolBehatGetEntityGeneratorResponse]:
        """Get the generator details for an entity

        Get the generator details for an entity

        :param entitytype: Entity type that can be created by a generator. (required)
        :type entitytype: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_behat_get_entity_generator_serialize(
            entitytype=entitytype,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolBehatGetEntityGeneratorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_behat_get_entity_generator_without_preload_content(
        self,
        entitytype: Annotated[Optional[StrictStr], Field(description="Entity type that can be created by a generator.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get the generator details for an entity

        Get the generator details for an entity

        :param entitytype: Entity type that can be created by a generator. (required)
        :type entitytype: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_behat_get_entity_generator_serialize(
            entitytype=entitytype,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolBehatGetEntityGeneratorResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_behat_get_entity_generator_serialize(
        self,
        entitytype,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_behat_get_entity_generator'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_behat_get_entity_generator'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_behat_get_entity_generator',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if entitytype is not None:
            _form_params += parse_form({'entitytype': entitytype})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_approve_data_request_args(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Approve a data request

        Approve a data request

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_approve_data_request_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyApproveDataRequestResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_approve_data_request(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyApproveDataRequestResponse:
        """Approve a data request

        Approve a data request

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_approve_data_request_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyApproveDataRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_approve_data_request_from_args(
        self,
        args
    ) -> ToolDataprivacyApproveDataRequestResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyApproveDataRequestResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_approve_data_request_with_http_info(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyApproveDataRequestResponse]:
        """Approve a data request

        Approve a data request

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_approve_data_request_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyApproveDataRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_approve_data_request_without_preload_content(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Approve a data request

        Approve a data request

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_approve_data_request_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyApproveDataRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_approve_data_request_serialize(
        self,
        requestid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_approve_data_request'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_approve_data_request'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_approve_data_request',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if requestid is not None:
            _form_params += parse_form({'requestid': requestid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_bulk_approve_data_requests_args(
        self,
        requestids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Bulk approve data requests

        Bulk approve data requests

        :param requestids: (required)
        :type requestids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_bulk_approve_data_requests_serialize(
            requestids=requestids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyBulkApproveDataRequestsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_bulk_approve_data_requests(
        self,
        requestids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyBulkApproveDataRequestsResponse:
        """Bulk approve data requests

        Bulk approve data requests

        :param requestids: (required)
        :type requestids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_bulk_approve_data_requests_serialize(
            requestids=requestids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyBulkApproveDataRequestsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_bulk_approve_data_requests_from_args(
        self,
        args
    ) -> ToolDataprivacyBulkApproveDataRequestsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyBulkApproveDataRequestsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_bulk_approve_data_requests_with_http_info(
        self,
        requestids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyBulkApproveDataRequestsResponse]:
        """Bulk approve data requests

        Bulk approve data requests

        :param requestids: (required)
        :type requestids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_bulk_approve_data_requests_serialize(
            requestids=requestids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyBulkApproveDataRequestsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_bulk_approve_data_requests_without_preload_content(
        self,
        requestids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Bulk approve data requests

        Bulk approve data requests

        :param requestids: (required)
        :type requestids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_bulk_approve_data_requests_serialize(
            requestids=requestids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyBulkApproveDataRequestsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_bulk_approve_data_requests_serialize(
        self,
        requestids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'requestids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_bulk_approve_data_requests'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_bulk_approve_data_requests'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_bulk_approve_data_requests',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if requestids is not None:
            _form_params += parse_form({'requestids': requestids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_bulk_deny_data_requests_args(
        self,
        requestids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Bulk deny data requests

        Bulk deny data requests

        :param requestids: (required)
        :type requestids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_bulk_deny_data_requests_serialize(
            requestids=requestids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyBulkDenyDataRequestsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_bulk_deny_data_requests(
        self,
        requestids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyBulkDenyDataRequestsResponse:
        """Bulk deny data requests

        Bulk deny data requests

        :param requestids: (required)
        :type requestids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_bulk_deny_data_requests_serialize(
            requestids=requestids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyBulkDenyDataRequestsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_bulk_deny_data_requests_from_args(
        self,
        args
    ) -> ToolDataprivacyBulkDenyDataRequestsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyBulkDenyDataRequestsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_bulk_deny_data_requests_with_http_info(
        self,
        requestids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyBulkDenyDataRequestsResponse]:
        """Bulk deny data requests

        Bulk deny data requests

        :param requestids: (required)
        :type requestids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_bulk_deny_data_requests_serialize(
            requestids=requestids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyBulkDenyDataRequestsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_bulk_deny_data_requests_without_preload_content(
        self,
        requestids: List[Optional[StrictInt]],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Bulk deny data requests

        Bulk deny data requests

        :param requestids: (required)
        :type requestids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_bulk_deny_data_requests_serialize(
            requestids=requestids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyBulkDenyDataRequestsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_bulk_deny_data_requests_serialize(
        self,
        requestids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'requestids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_bulk_deny_data_requests'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_bulk_deny_data_requests'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_bulk_deny_data_requests',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if requestids is not None:
            _form_params += parse_form({'requestids': requestids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_cancel_data_request_args(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Cancel the data request made by the user

        Cancel the data request made by the user

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_cancel_data_request_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCancelDataRequestResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_cancel_data_request(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyCancelDataRequestResponse:
        """Cancel the data request made by the user

        Cancel the data request made by the user

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_cancel_data_request_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCancelDataRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_cancel_data_request_from_args(
        self,
        args
    ) -> ToolDataprivacyCancelDataRequestResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCancelDataRequestResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_cancel_data_request_with_http_info(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyCancelDataRequestResponse]:
        """Cancel the data request made by the user

        Cancel the data request made by the user

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_cancel_data_request_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCancelDataRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_cancel_data_request_without_preload_content(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Cancel the data request made by the user

        Cancel the data request made by the user

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_cancel_data_request_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCancelDataRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_cancel_data_request_serialize(
        self,
        requestid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_cancel_data_request'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_cancel_data_request'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_cancel_data_request',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if requestid is not None:
            _form_params += parse_form({'requestid': requestid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_confirm_contexts_for_deletion_args(
        self,
        ids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of expired context record IDs")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Mark the selected expired contexts as confirmed for deletion

        Mark the selected expired contexts as confirmed for deletion

        :param ids: Array of expired context record IDs
        :type ids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_confirm_contexts_for_deletion_serialize(
            ids=ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyConfirmContextsForDeletionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_confirm_contexts_for_deletion(
        self,
        ids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of expired context record IDs")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyConfirmContextsForDeletionResponse:
        """Mark the selected expired contexts as confirmed for deletion

        Mark the selected expired contexts as confirmed for deletion

        :param ids: Array of expired context record IDs
        :type ids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_confirm_contexts_for_deletion_serialize(
            ids=ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyConfirmContextsForDeletionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_confirm_contexts_for_deletion_from_args(
        self,
        args
    ) -> ToolDataprivacyConfirmContextsForDeletionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyConfirmContextsForDeletionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_confirm_contexts_for_deletion_with_http_info(
        self,
        ids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of expired context record IDs")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyConfirmContextsForDeletionResponse]:
        """Mark the selected expired contexts as confirmed for deletion

        Mark the selected expired contexts as confirmed for deletion

        :param ids: Array of expired context record IDs
        :type ids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_confirm_contexts_for_deletion_serialize(
            ids=ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyConfirmContextsForDeletionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_confirm_contexts_for_deletion_without_preload_content(
        self,
        ids: Annotated[Optional[List[Optional[StrictInt]]], Field(description="Array of expired context record IDs")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Mark the selected expired contexts as confirmed for deletion

        Mark the selected expired contexts as confirmed for deletion

        :param ids: Array of expired context record IDs
        :type ids: List[Optional[int]]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_confirm_contexts_for_deletion_serialize(
            ids=ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyConfirmContextsForDeletionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_confirm_contexts_for_deletion_serialize(
        self,
        ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'ids': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_confirm_contexts_for_deletion'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_confirm_contexts_for_deletion'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_confirm_contexts_for_deletion',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if ids is not None:
            _form_params += parse_form({'ids': ids})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_contact_dpo_args(
        self,
        message: Annotated[Optional[StrictStr], Field(description="The user's message to the Data Protection Officer(s)")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Contact the site Data Protection Officer(s)

        Contact the site Data Protection Officer(s)

        :param message: The user's message to the Data Protection Officer(s) (required)
        :type message: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_contact_dpo_serialize(
            message=message,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyContactDpoResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_contact_dpo(
        self,
        message: Annotated[Optional[StrictStr], Field(description="The user's message to the Data Protection Officer(s)")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyContactDpoResponse:
        """Contact the site Data Protection Officer(s)

        Contact the site Data Protection Officer(s)

        :param message: The user's message to the Data Protection Officer(s) (required)
        :type message: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_contact_dpo_serialize(
            message=message,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyContactDpoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_contact_dpo_from_args(
        self,
        args
    ) -> ToolDataprivacyContactDpoResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyContactDpoResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_contact_dpo_with_http_info(
        self,
        message: Annotated[Optional[StrictStr], Field(description="The user's message to the Data Protection Officer(s)")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyContactDpoResponse]:
        """Contact the site Data Protection Officer(s)

        Contact the site Data Protection Officer(s)

        :param message: The user's message to the Data Protection Officer(s) (required)
        :type message: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_contact_dpo_serialize(
            message=message,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyContactDpoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_contact_dpo_without_preload_content(
        self,
        message: Annotated[Optional[StrictStr], Field(description="The user's message to the Data Protection Officer(s)")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Contact the site Data Protection Officer(s)

        Contact the site Data Protection Officer(s)

        :param message: The user's message to the Data Protection Officer(s) (required)
        :type message: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_contact_dpo_serialize(
            message=message,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyContactDpoResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_contact_dpo_serialize(
        self,
        message,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_contact_dpo'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_contact_dpo'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_contact_dpo',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if message is not None:
            _form_params += parse_form({'message': message})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_create_category_form_args(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data to create the category, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Adds a data category

        Adds a data category

        :param jsonformdata: The data to create the category, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_create_category_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCreateCategoryFormResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_create_category_form(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data to create the category, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyCreateCategoryFormResponse:
        """Adds a data category

        Adds a data category

        :param jsonformdata: The data to create the category, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_create_category_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCreateCategoryFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_create_category_form_from_args(
        self,
        args
    ) -> ToolDataprivacyCreateCategoryFormResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCreateCategoryFormResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_create_category_form_with_http_info(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data to create the category, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyCreateCategoryFormResponse]:
        """Adds a data category

        Adds a data category

        :param jsonformdata: The data to create the category, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_create_category_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCreateCategoryFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_create_category_form_without_preload_content(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data to create the category, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Adds a data category

        Adds a data category

        :param jsonformdata: The data to create the category, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_create_category_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCreateCategoryFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_create_category_form_serialize(
        self,
        jsonformdata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_create_category_form'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_create_category_form'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_create_category_form',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if jsonformdata is not None:
            _form_params += parse_form({'jsonformdata': jsonformdata})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_create_data_request_args(
        self,
        type: Annotated[Optional[StrictInt], Field(description="The type of data request to create. 1 for export, 2 for data deletion.")],
        comments: Annotated[Optional[StrictStr], Field(description="Comments for the data request.")] = None,
        foruserid: Annotated[Optional[StrictInt], Field(description="The id of the user to create the data request for. Empty for current user.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Creates a data request.

        Creates a data request.

        :param type: The type of data request to create. 1 for export, 2 for data deletion. (required)
        :type type: int
        :param comments: Comments for the data request.
        :type comments: str
        :param foruserid: The id of the user to create the data request for. Empty for current user.
        :type foruserid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_create_data_request_serialize(
            type=type,
            comments=comments,
            foruserid=foruserid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCreateDataRequestResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_create_data_request(
        self,
        type: Annotated[Optional[StrictInt], Field(description="The type of data request to create. 1 for export, 2 for data deletion.")],
        comments: Annotated[Optional[StrictStr], Field(description="Comments for the data request.")] = None,
        foruserid: Annotated[Optional[StrictInt], Field(description="The id of the user to create the data request for. Empty for current user.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyCreateDataRequestResponse:
        """Creates a data request.

        Creates a data request.

        :param type: The type of data request to create. 1 for export, 2 for data deletion. (required)
        :type type: int
        :param comments: Comments for the data request.
        :type comments: str
        :param foruserid: The id of the user to create the data request for. Empty for current user.
        :type foruserid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_create_data_request_serialize(
            type=type,
            comments=comments,
            foruserid=foruserid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCreateDataRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_create_data_request_from_args(
        self,
        args
    ) -> ToolDataprivacyCreateDataRequestResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCreateDataRequestResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_create_data_request_with_http_info(
        self,
        type: Annotated[Optional[StrictInt], Field(description="The type of data request to create. 1 for export, 2 for data deletion.")],
        comments: Annotated[Optional[StrictStr], Field(description="Comments for the data request.")] = None,
        foruserid: Annotated[Optional[StrictInt], Field(description="The id of the user to create the data request for. Empty for current user.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyCreateDataRequestResponse]:
        """Creates a data request.

        Creates a data request.

        :param type: The type of data request to create. 1 for export, 2 for data deletion. (required)
        :type type: int
        :param comments: Comments for the data request.
        :type comments: str
        :param foruserid: The id of the user to create the data request for. Empty for current user.
        :type foruserid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_create_data_request_serialize(
            type=type,
            comments=comments,
            foruserid=foruserid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCreateDataRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_create_data_request_without_preload_content(
        self,
        type: Annotated[Optional[StrictInt], Field(description="The type of data request to create. 1 for export, 2 for data deletion.")],
        comments: Annotated[Optional[StrictStr], Field(description="Comments for the data request.")] = None,
        foruserid: Annotated[Optional[StrictInt], Field(description="The id of the user to create the data request for. Empty for current user.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Creates a data request.

        Creates a data request.

        :param type: The type of data request to create. 1 for export, 2 for data deletion. (required)
        :type type: int
        :param comments: Comments for the data request.
        :type comments: str
        :param foruserid: The id of the user to create the data request for. Empty for current user.
        :type foruserid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_create_data_request_serialize(
            type=type,
            comments=comments,
            foruserid=foruserid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCreateDataRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_create_data_request_serialize(
        self,
        type,
        comments,
        foruserid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_create_data_request'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_create_data_request'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_create_data_request',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if comments is not None:
            _form_params += parse_form({'comments': comments})
        if foruserid is not None:
            _form_params += parse_form({'foruserid': foruserid})
        if type is not None:
            _form_params += parse_form({'type': type})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_create_purpose_form_args(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data to create the purpose, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Adds a data purpose

        Adds a data purpose

        :param jsonformdata: The data to create the purpose, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_create_purpose_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCreatePurposeFormResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_create_purpose_form(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data to create the purpose, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyCreatePurposeFormResponse:
        """Adds a data purpose

        Adds a data purpose

        :param jsonformdata: The data to create the purpose, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_create_purpose_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCreatePurposeFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_create_purpose_form_from_args(
        self,
        args
    ) -> ToolDataprivacyCreatePurposeFormResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCreatePurposeFormResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_create_purpose_form_with_http_info(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data to create the purpose, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyCreatePurposeFormResponse]:
        """Adds a data purpose

        Adds a data purpose

        :param jsonformdata: The data to create the purpose, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_create_purpose_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCreatePurposeFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_create_purpose_form_without_preload_content(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data to create the purpose, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Adds a data purpose

        Adds a data purpose

        :param jsonformdata: The data to create the purpose, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_create_purpose_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyCreatePurposeFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_create_purpose_form_serialize(
        self,
        jsonformdata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_create_purpose_form'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_create_purpose_form'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_create_purpose_form',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if jsonformdata is not None:
            _form_params += parse_form({'jsonformdata': jsonformdata})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_delete_category_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The category ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes an existing data category

        Deletes an existing data category

        :param id: The category ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_delete_category_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyDeleteCategoryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_delete_category(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The category ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyDeleteCategoryResponse:
        """Deletes an existing data category

        Deletes an existing data category

        :param id: The category ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_delete_category_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyDeleteCategoryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_delete_category_from_args(
        self,
        args
    ) -> ToolDataprivacyDeleteCategoryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyDeleteCategoryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_delete_category_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The category ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyDeleteCategoryResponse]:
        """Deletes an existing data category

        Deletes an existing data category

        :param id: The category ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_delete_category_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyDeleteCategoryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_delete_category_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The category ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes an existing data category

        Deletes an existing data category

        :param id: The category ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_delete_category_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyDeleteCategoryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_delete_category_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_delete_category'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_delete_category'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_delete_category',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_delete_purpose_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The purpose ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deletes an existing data purpose

        Deletes an existing data purpose

        :param id: The purpose ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_delete_purpose_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyDeletePurposeResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_delete_purpose(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The purpose ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyDeletePurposeResponse:
        """Deletes an existing data purpose

        Deletes an existing data purpose

        :param id: The purpose ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_delete_purpose_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyDeletePurposeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_delete_purpose_from_args(
        self,
        args
    ) -> ToolDataprivacyDeletePurposeResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyDeletePurposeResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_delete_purpose_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The purpose ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyDeletePurposeResponse]:
        """Deletes an existing data purpose

        Deletes an existing data purpose

        :param id: The purpose ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_delete_purpose_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyDeletePurposeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_delete_purpose_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The purpose ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deletes an existing data purpose

        Deletes an existing data purpose

        :param id: The purpose ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_delete_purpose_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyDeletePurposeResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_delete_purpose_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_delete_purpose'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_delete_purpose'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_delete_purpose',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_deny_data_request_args(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Deny a data request

        Deny a data request

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_deny_data_request_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyDenyDataRequestResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_deny_data_request(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyDenyDataRequestResponse:
        """Deny a data request

        Deny a data request

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_deny_data_request_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyDenyDataRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_deny_data_request_from_args(
        self,
        args
    ) -> ToolDataprivacyDenyDataRequestResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyDenyDataRequestResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_deny_data_request_with_http_info(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyDenyDataRequestResponse]:
        """Deny a data request

        Deny a data request

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_deny_data_request_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyDenyDataRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_deny_data_request_without_preload_content(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Deny a data request

        Deny a data request

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_deny_data_request_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyDenyDataRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_deny_data_request_serialize(
        self,
        requestid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_deny_data_request'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_deny_data_request'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_deny_data_request',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if requestid is not None:
            _form_params += parse_form({'requestid': requestid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_get_access_information_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Retrieving privacy API access (permissions) information for the current user.

        Retrieving privacy API access (permissions) information for the current user.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_access_information_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetAccessInformationResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_get_access_information(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyGetAccessInformationResponse:
        """Retrieving privacy API access (permissions) information for the current user.

        Retrieving privacy API access (permissions) information for the current user.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_access_information_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_get_access_information_from_args(
        self,
        args
    ) -> ToolDataprivacyGetAccessInformationResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetAccessInformationResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_get_access_information_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyGetAccessInformationResponse]:
        """Retrieving privacy API access (permissions) information for the current user.

        Retrieving privacy API access (permissions) information for the current user.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_access_information_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_get_access_information_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieving privacy API access (permissions) information for the current user.

        Retrieving privacy API access (permissions) information for the current user.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_access_information_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetAccessInformationResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_get_access_information_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_get_access_information'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_get_access_information'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_get_access_information',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_get_activity_options_args(
        self,
        nodefaults: Annotated[Optional[StrictBool], Field(description="Whether to fetch all activities or only those without defaults")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetches a list of activity options

        Fetches a list of activity options

        :param nodefaults: Whether to fetch all activities or only those without defaults
        :type nodefaults: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_activity_options_serialize(
            nodefaults=nodefaults,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetActivityOptionsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_get_activity_options(
        self,
        nodefaults: Annotated[Optional[StrictBool], Field(description="Whether to fetch all activities or only those without defaults")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyGetActivityOptionsResponse:
        """Fetches a list of activity options

        Fetches a list of activity options

        :param nodefaults: Whether to fetch all activities or only those without defaults
        :type nodefaults: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_activity_options_serialize(
            nodefaults=nodefaults,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetActivityOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_get_activity_options_from_args(
        self,
        args
    ) -> ToolDataprivacyGetActivityOptionsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetActivityOptionsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_get_activity_options_with_http_info(
        self,
        nodefaults: Annotated[Optional[StrictBool], Field(description="Whether to fetch all activities or only those without defaults")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyGetActivityOptionsResponse]:
        """Fetches a list of activity options

        Fetches a list of activity options

        :param nodefaults: Whether to fetch all activities or only those without defaults
        :type nodefaults: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_activity_options_serialize(
            nodefaults=nodefaults,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetActivityOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_get_activity_options_without_preload_content(
        self,
        nodefaults: Annotated[Optional[StrictBool], Field(description="Whether to fetch all activities or only those without defaults")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetches a list of activity options

        Fetches a list of activity options

        :param nodefaults: Whether to fetch all activities or only those without defaults
        :type nodefaults: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_activity_options_serialize(
            nodefaults=nodefaults,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetActivityOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_get_activity_options_serialize(
        self,
        nodefaults,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_get_activity_options'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_get_activity_options'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_get_activity_options',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if nodefaults is not None:
            _form_params += parse_form({'nodefaults': nodefaults})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_get_category_options_args(
        self,
        includeinherit: Annotated[Optional[StrictBool], Field(description="Include option \\\"Inherit\\\"")] = None,
        includenotset: Annotated[Optional[StrictBool], Field(description="Include option \\\"Not set\\\"")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetches a list of data category options

        Fetches a list of data category options

        :param includeinherit: Include option \\\"Inherit\\\"
        :type includeinherit: bool
        :param includenotset: Include option \\\"Not set\\\"
        :type includenotset: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_category_options_serialize(
            includeinherit=includeinherit,
            includenotset=includenotset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetCategoryOptionsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_get_category_options(
        self,
        includeinherit: Annotated[Optional[StrictBool], Field(description="Include option \\\"Inherit\\\"")] = None,
        includenotset: Annotated[Optional[StrictBool], Field(description="Include option \\\"Not set\\\"")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyGetCategoryOptionsResponse:
        """Fetches a list of data category options

        Fetches a list of data category options

        :param includeinherit: Include option \\\"Inherit\\\"
        :type includeinherit: bool
        :param includenotset: Include option \\\"Not set\\\"
        :type includenotset: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_category_options_serialize(
            includeinherit=includeinherit,
            includenotset=includenotset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetCategoryOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_get_category_options_from_args(
        self,
        args
    ) -> ToolDataprivacyGetCategoryOptionsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetCategoryOptionsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_get_category_options_with_http_info(
        self,
        includeinherit: Annotated[Optional[StrictBool], Field(description="Include option \\\"Inherit\\\"")] = None,
        includenotset: Annotated[Optional[StrictBool], Field(description="Include option \\\"Not set\\\"")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyGetCategoryOptionsResponse]:
        """Fetches a list of data category options

        Fetches a list of data category options

        :param includeinherit: Include option \\\"Inherit\\\"
        :type includeinherit: bool
        :param includenotset: Include option \\\"Not set\\\"
        :type includenotset: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_category_options_serialize(
            includeinherit=includeinherit,
            includenotset=includenotset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetCategoryOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_get_category_options_without_preload_content(
        self,
        includeinherit: Annotated[Optional[StrictBool], Field(description="Include option \\\"Inherit\\\"")] = None,
        includenotset: Annotated[Optional[StrictBool], Field(description="Include option \\\"Not set\\\"")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetches a list of data category options

        Fetches a list of data category options

        :param includeinherit: Include option \\\"Inherit\\\"
        :type includeinherit: bool
        :param includenotset: Include option \\\"Not set\\\"
        :type includenotset: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_category_options_serialize(
            includeinherit=includeinherit,
            includenotset=includenotset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetCategoryOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_get_category_options_serialize(
        self,
        includeinherit,
        includenotset,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_get_category_options'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_get_category_options'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_get_category_options',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if includeinherit is not None:
            _form_params += parse_form({'includeinherit': includeinherit})
        if includenotset is not None:
            _form_params += parse_form({'includenotset': includenotset})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_get_data_request_args(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetch the details of a user's data request

        Fetch the details of a user's data request

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_data_request_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetDataRequestResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_get_data_request(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyGetDataRequestResponse:
        """Fetch the details of a user's data request

        Fetch the details of a user's data request

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_data_request_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetDataRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_get_data_request_from_args(
        self,
        args
    ) -> ToolDataprivacyGetDataRequestResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetDataRequestResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_get_data_request_with_http_info(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyGetDataRequestResponse]:
        """Fetch the details of a user's data request

        Fetch the details of a user's data request

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_data_request_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetDataRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_get_data_request_without_preload_content(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetch the details of a user's data request

        Fetch the details of a user's data request

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_data_request_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetDataRequestResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_get_data_request_serialize(
        self,
        requestid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_get_data_request'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_get_data_request'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_get_data_request',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if requestid is not None:
            _form_params += parse_form({'requestid': requestid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_get_data_requests_args(
        self,
        creationmethods: Annotated[Optional[List[Optional[StrictInt]]], Field(description="The creation methods of the data requests to get. 0 for manual, 1 for automatic.")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="The number to start getting the data requests from.")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="The number of data requests to get.")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The field to sort the data requests by.")] = None,
        statuses: Annotated[Optional[List[Optional[StrictInt]]], Field(description="The statuses of the data requests to get.                     0 for pending 1 preprocessing, 2 awaiting approval, 3 approved,                     4 processed, 5 completed, 6 cancelled, 7 rejected.")] = None,
        types: Annotated[Optional[List[Optional[StrictInt]]], Field(description="The types of the data requests to get. 1 for export, 2 for data deletion.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user to get the data requests for. Empty for all users.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Gets data request.

        Gets data request.

        :param creationmethods: The creation methods of the data requests to get. 0 for manual, 1 for automatic.
        :type creationmethods: List[Optional[int]]
        :param limitfrom: The number to start getting the data requests from.
        :type limitfrom: int
        :param limitnum: The number of data requests to get.
        :type limitnum: int
        :param sort: The field to sort the data requests by.
        :type sort: str
        :param statuses: The statuses of the data requests to get.                     0 for pending 1 preprocessing, 2 awaiting approval, 3 approved,                     4 processed, 5 completed, 6 cancelled, 7 rejected.
        :type statuses: List[Optional[int]]
        :param types: The types of the data requests to get. 1 for export, 2 for data deletion.
        :type types: List[Optional[int]]
        :param userid: The id of the user to get the data requests for. Empty for all users.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_data_requests_serialize(
            creationmethods=creationmethods,
            limitfrom=limitfrom,
            limitnum=limitnum,
            sort=sort,
            statuses=statuses,
            types=types,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetDataRequestsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_get_data_requests(
        self,
        creationmethods: Annotated[Optional[List[Optional[StrictInt]]], Field(description="The creation methods of the data requests to get. 0 for manual, 1 for automatic.")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="The number to start getting the data requests from.")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="The number of data requests to get.")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The field to sort the data requests by.")] = None,
        statuses: Annotated[Optional[List[Optional[StrictInt]]], Field(description="The statuses of the data requests to get.                     0 for pending 1 preprocessing, 2 awaiting approval, 3 approved,                     4 processed, 5 completed, 6 cancelled, 7 rejected.")] = None,
        types: Annotated[Optional[List[Optional[StrictInt]]], Field(description="The types of the data requests to get. 1 for export, 2 for data deletion.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user to get the data requests for. Empty for all users.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyGetDataRequestsResponse:
        """Gets data request.

        Gets data request.

        :param creationmethods: The creation methods of the data requests to get. 0 for manual, 1 for automatic.
        :type creationmethods: List[Optional[int]]
        :param limitfrom: The number to start getting the data requests from.
        :type limitfrom: int
        :param limitnum: The number of data requests to get.
        :type limitnum: int
        :param sort: The field to sort the data requests by.
        :type sort: str
        :param statuses: The statuses of the data requests to get.                     0 for pending 1 preprocessing, 2 awaiting approval, 3 approved,                     4 processed, 5 completed, 6 cancelled, 7 rejected.
        :type statuses: List[Optional[int]]
        :param types: The types of the data requests to get. 1 for export, 2 for data deletion.
        :type types: List[Optional[int]]
        :param userid: The id of the user to get the data requests for. Empty for all users.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_data_requests_serialize(
            creationmethods=creationmethods,
            limitfrom=limitfrom,
            limitnum=limitnum,
            sort=sort,
            statuses=statuses,
            types=types,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetDataRequestsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_get_data_requests_from_args(
        self,
        args
    ) -> ToolDataprivacyGetDataRequestsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetDataRequestsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_get_data_requests_with_http_info(
        self,
        creationmethods: Annotated[Optional[List[Optional[StrictInt]]], Field(description="The creation methods of the data requests to get. 0 for manual, 1 for automatic.")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="The number to start getting the data requests from.")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="The number of data requests to get.")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The field to sort the data requests by.")] = None,
        statuses: Annotated[Optional[List[Optional[StrictInt]]], Field(description="The statuses of the data requests to get.                     0 for pending 1 preprocessing, 2 awaiting approval, 3 approved,                     4 processed, 5 completed, 6 cancelled, 7 rejected.")] = None,
        types: Annotated[Optional[List[Optional[StrictInt]]], Field(description="The types of the data requests to get. 1 for export, 2 for data deletion.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user to get the data requests for. Empty for all users.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyGetDataRequestsResponse]:
        """Gets data request.

        Gets data request.

        :param creationmethods: The creation methods of the data requests to get. 0 for manual, 1 for automatic.
        :type creationmethods: List[Optional[int]]
        :param limitfrom: The number to start getting the data requests from.
        :type limitfrom: int
        :param limitnum: The number of data requests to get.
        :type limitnum: int
        :param sort: The field to sort the data requests by.
        :type sort: str
        :param statuses: The statuses of the data requests to get.                     0 for pending 1 preprocessing, 2 awaiting approval, 3 approved,                     4 processed, 5 completed, 6 cancelled, 7 rejected.
        :type statuses: List[Optional[int]]
        :param types: The types of the data requests to get. 1 for export, 2 for data deletion.
        :type types: List[Optional[int]]
        :param userid: The id of the user to get the data requests for. Empty for all users.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_data_requests_serialize(
            creationmethods=creationmethods,
            limitfrom=limitfrom,
            limitnum=limitnum,
            sort=sort,
            statuses=statuses,
            types=types,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetDataRequestsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_get_data_requests_without_preload_content(
        self,
        creationmethods: Annotated[Optional[List[Optional[StrictInt]]], Field(description="The creation methods of the data requests to get. 0 for manual, 1 for automatic.")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="The number to start getting the data requests from.")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="The number of data requests to get.")] = None,
        sort: Annotated[Optional[StrictStr], Field(description="The field to sort the data requests by.")] = None,
        statuses: Annotated[Optional[List[Optional[StrictInt]]], Field(description="The statuses of the data requests to get.                     0 for pending 1 preprocessing, 2 awaiting approval, 3 approved,                     4 processed, 5 completed, 6 cancelled, 7 rejected.")] = None,
        types: Annotated[Optional[List[Optional[StrictInt]]], Field(description="The types of the data requests to get. 1 for export, 2 for data deletion.")] = None,
        userid: Annotated[Optional[StrictInt], Field(description="The id of the user to get the data requests for. Empty for all users.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Gets data request.

        Gets data request.

        :param creationmethods: The creation methods of the data requests to get. 0 for manual, 1 for automatic.
        :type creationmethods: List[Optional[int]]
        :param limitfrom: The number to start getting the data requests from.
        :type limitfrom: int
        :param limitnum: The number of data requests to get.
        :type limitnum: int
        :param sort: The field to sort the data requests by.
        :type sort: str
        :param statuses: The statuses of the data requests to get.                     0 for pending 1 preprocessing, 2 awaiting approval, 3 approved,                     4 processed, 5 completed, 6 cancelled, 7 rejected.
        :type statuses: List[Optional[int]]
        :param types: The types of the data requests to get. 1 for export, 2 for data deletion.
        :type types: List[Optional[int]]
        :param userid: The id of the user to get the data requests for. Empty for all users.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_data_requests_serialize(
            creationmethods=creationmethods,
            limitfrom=limitfrom,
            limitnum=limitnum,
            sort=sort,
            statuses=statuses,
            types=types,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetDataRequestsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_get_data_requests_serialize(
        self,
        creationmethods,
        limitfrom,
        limitnum,
        sort,
        statuses,
        types,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'creationmethods': 'csv',
            'statuses': 'csv',
            'types': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_get_data_requests'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_get_data_requests'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_get_data_requests',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if creationmethods is not None:
            _form_params += parse_form({'creationmethods': creationmethods})
        if limitfrom is not None:
            _form_params += parse_form({'limitfrom': limitfrom})
        if limitnum is not None:
            _form_params += parse_form({'limitnum': limitnum})
        if sort is not None:
            _form_params += parse_form({'sort': sort})
        if statuses is not None:
            _form_params += parse_form({'statuses': statuses})
        if types is not None:
            _form_params += parse_form({'types': types})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_get_purpose_options_args(
        self,
        includeinherit: Annotated[Optional[StrictBool], Field(description="Include option \\\"Inherit\\\"")] = None,
        includenotset: Annotated[Optional[StrictBool], Field(description="Include option \\\"Not set\\\"")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetches a list of data storage purpose options

        Fetches a list of data storage purpose options

        :param includeinherit: Include option \\\"Inherit\\\"
        :type includeinherit: bool
        :param includenotset: Include option \\\"Not set\\\"
        :type includenotset: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_purpose_options_serialize(
            includeinherit=includeinherit,
            includenotset=includenotset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetPurposeOptionsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_get_purpose_options(
        self,
        includeinherit: Annotated[Optional[StrictBool], Field(description="Include option \\\"Inherit\\\"")] = None,
        includenotset: Annotated[Optional[StrictBool], Field(description="Include option \\\"Not set\\\"")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyGetPurposeOptionsResponse:
        """Fetches a list of data storage purpose options

        Fetches a list of data storage purpose options

        :param includeinherit: Include option \\\"Inherit\\\"
        :type includeinherit: bool
        :param includenotset: Include option \\\"Not set\\\"
        :type includenotset: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_purpose_options_serialize(
            includeinherit=includeinherit,
            includenotset=includenotset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetPurposeOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_get_purpose_options_from_args(
        self,
        args
    ) -> ToolDataprivacyGetPurposeOptionsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetPurposeOptionsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_get_purpose_options_with_http_info(
        self,
        includeinherit: Annotated[Optional[StrictBool], Field(description="Include option \\\"Inherit\\\"")] = None,
        includenotset: Annotated[Optional[StrictBool], Field(description="Include option \\\"Not set\\\"")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyGetPurposeOptionsResponse]:
        """Fetches a list of data storage purpose options

        Fetches a list of data storage purpose options

        :param includeinherit: Include option \\\"Inherit\\\"
        :type includeinherit: bool
        :param includenotset: Include option \\\"Not set\\\"
        :type includenotset: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_purpose_options_serialize(
            includeinherit=includeinherit,
            includenotset=includenotset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetPurposeOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_get_purpose_options_without_preload_content(
        self,
        includeinherit: Annotated[Optional[StrictBool], Field(description="Include option \\\"Inherit\\\"")] = None,
        includenotset: Annotated[Optional[StrictBool], Field(description="Include option \\\"Not set\\\"")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetches a list of data storage purpose options

        Fetches a list of data storage purpose options

        :param includeinherit: Include option \\\"Inherit\\\"
        :type includeinherit: bool
        :param includenotset: Include option \\\"Not set\\\"
        :type includenotset: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_purpose_options_serialize(
            includeinherit=includeinherit,
            includenotset=includenotset,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyGetPurposeOptionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_get_purpose_options_serialize(
        self,
        includeinherit,
        includenotset,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_get_purpose_options'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_get_purpose_options'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_get_purpose_options',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if includeinherit is not None:
            _form_params += parse_form({'includeinherit': includeinherit})
        if includenotset is not None:
            _form_params += parse_form({'includenotset': includenotset})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_get_users_args(
        self,
        query: Annotated[Optional[StrictStr], Field(description="The search query")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetches a list of users

        Fetches a list of users

        :param query: The search query (required)
        :type query: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_users_serialize(
            query=query,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreUserSearchIdentityResponseListInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_get_users(
        self,
        query: Annotated[Optional[StrictStr], Field(description="The search query")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[CoreUserSearchIdentityResponseListInner]:
        """Fetches a list of users

        Fetches a list of users

        :param query: The search query (required)
        :type query: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_users_serialize(
            query=query,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreUserSearchIdentityResponseListInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_get_users_from_args(
        self,
        args
    ) -> List[CoreUserSearchIdentityResponseListInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreUserSearchIdentityResponseListInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_get_users_with_http_info(
        self,
        query: Annotated[Optional[StrictStr], Field(description="The search query")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[CoreUserSearchIdentityResponseListInner]]:
        """Fetches a list of users

        Fetches a list of users

        :param query: The search query (required)
        :type query: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_users_serialize(
            query=query,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreUserSearchIdentityResponseListInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_get_users_without_preload_content(
        self,
        query: Annotated[Optional[StrictStr], Field(description="The search query")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetches a list of users

        Fetches a list of users

        :param query: The search query (required)
        :type query: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_get_users_serialize(
            query=query,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[CoreUserSearchIdentityResponseListInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_get_users_serialize(
        self,
        query,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_get_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_get_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_get_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if query is not None:
            _form_params += parse_form({'query': query})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_mark_complete_args(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Mark a user's general enquiry as complete

        Mark a user's general enquiry as complete

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_mark_complete_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyMarkCompleteResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_mark_complete(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyMarkCompleteResponse:
        """Mark a user's general enquiry as complete

        Mark a user's general enquiry as complete

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_mark_complete_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyMarkCompleteResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_mark_complete_from_args(
        self,
        args
    ) -> ToolDataprivacyMarkCompleteResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyMarkCompleteResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_mark_complete_with_http_info(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyMarkCompleteResponse]:
        """Mark a user's general enquiry as complete

        Mark a user's general enquiry as complete

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_mark_complete_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyMarkCompleteResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_mark_complete_without_preload_content(
        self,
        requestid: Annotated[Optional[StrictInt], Field(description="The request ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Mark a user's general enquiry as complete

        Mark a user's general enquiry as complete

        :param requestid: The request ID (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_mark_complete_serialize(
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyMarkCompleteResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_mark_complete_serialize(
        self,
        requestid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_mark_complete'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_mark_complete'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_mark_complete',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if requestid is not None:
            _form_params += parse_form({'requestid': requestid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_set_context_defaults_args(
        self,
        category: Annotated[Optional[StrictInt], Field(description="The default category for the given context level")],
        contextlevel: Annotated[Optional[StrictInt], Field(description="The context level")],
        purpose: Annotated[Optional[StrictInt], Field(description="The default purpose for the given context level")],
        activity: Annotated[Optional[StrictStr], Field(description="The plugin name of the activity")] = None,
        override: Annotated[Optional[StrictBool], Field(description="Whether to override existing instances with the defaults")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Updates the default category and purpose for a given context level (and optionally, a plugin)

        Updates the default category and purpose for a given context level (and optionally, a plugin)

        :param category: The default category for the given context level (required)
        :type category: int
        :param contextlevel: The context level (required)
        :type contextlevel: int
        :param purpose: The default purpose for the given context level (required)
        :type purpose: int
        :param activity: The plugin name of the activity
        :type activity: str
        :param override: Whether to override existing instances with the defaults
        :type override: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_set_context_defaults_serialize(
            category=category,
            contextlevel=contextlevel,
            purpose=purpose,
            activity=activity,
            override=override,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySetContextDefaultsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_set_context_defaults(
        self,
        category: Annotated[Optional[StrictInt], Field(description="The default category for the given context level")],
        contextlevel: Annotated[Optional[StrictInt], Field(description="The context level")],
        purpose: Annotated[Optional[StrictInt], Field(description="The default purpose for the given context level")],
        activity: Annotated[Optional[StrictStr], Field(description="The plugin name of the activity")] = None,
        override: Annotated[Optional[StrictBool], Field(description="Whether to override existing instances with the defaults")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacySetContextDefaultsResponse:
        """Updates the default category and purpose for a given context level (and optionally, a plugin)

        Updates the default category and purpose for a given context level (and optionally, a plugin)

        :param category: The default category for the given context level (required)
        :type category: int
        :param contextlevel: The context level (required)
        :type contextlevel: int
        :param purpose: The default purpose for the given context level (required)
        :type purpose: int
        :param activity: The plugin name of the activity
        :type activity: str
        :param override: Whether to override existing instances with the defaults
        :type override: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_set_context_defaults_serialize(
            category=category,
            contextlevel=contextlevel,
            purpose=purpose,
            activity=activity,
            override=override,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySetContextDefaultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_set_context_defaults_from_args(
        self,
        args
    ) -> ToolDataprivacySetContextDefaultsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySetContextDefaultsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_set_context_defaults_with_http_info(
        self,
        category: Annotated[Optional[StrictInt], Field(description="The default category for the given context level")],
        contextlevel: Annotated[Optional[StrictInt], Field(description="The context level")],
        purpose: Annotated[Optional[StrictInt], Field(description="The default purpose for the given context level")],
        activity: Annotated[Optional[StrictStr], Field(description="The plugin name of the activity")] = None,
        override: Annotated[Optional[StrictBool], Field(description="Whether to override existing instances with the defaults")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacySetContextDefaultsResponse]:
        """Updates the default category and purpose for a given context level (and optionally, a plugin)

        Updates the default category and purpose for a given context level (and optionally, a plugin)

        :param category: The default category for the given context level (required)
        :type category: int
        :param contextlevel: The context level (required)
        :type contextlevel: int
        :param purpose: The default purpose for the given context level (required)
        :type purpose: int
        :param activity: The plugin name of the activity
        :type activity: str
        :param override: Whether to override existing instances with the defaults
        :type override: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_set_context_defaults_serialize(
            category=category,
            contextlevel=contextlevel,
            purpose=purpose,
            activity=activity,
            override=override,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySetContextDefaultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_set_context_defaults_without_preload_content(
        self,
        category: Annotated[Optional[StrictInt], Field(description="The default category for the given context level")],
        contextlevel: Annotated[Optional[StrictInt], Field(description="The context level")],
        purpose: Annotated[Optional[StrictInt], Field(description="The default purpose for the given context level")],
        activity: Annotated[Optional[StrictStr], Field(description="The plugin name of the activity")] = None,
        override: Annotated[Optional[StrictBool], Field(description="Whether to override existing instances with the defaults")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Updates the default category and purpose for a given context level (and optionally, a plugin)

        Updates the default category and purpose for a given context level (and optionally, a plugin)

        :param category: The default category for the given context level (required)
        :type category: int
        :param contextlevel: The context level (required)
        :type contextlevel: int
        :param purpose: The default purpose for the given context level (required)
        :type purpose: int
        :param activity: The plugin name of the activity
        :type activity: str
        :param override: Whether to override existing instances with the defaults
        :type override: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_set_context_defaults_serialize(
            category=category,
            contextlevel=contextlevel,
            purpose=purpose,
            activity=activity,
            override=override,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySetContextDefaultsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_set_context_defaults_serialize(
        self,
        category,
        contextlevel,
        purpose,
        activity,
        override,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_set_context_defaults'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_set_context_defaults'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_set_context_defaults',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if activity is not None:
            _form_params += parse_form({'activity': activity})
        if category is not None:
            _form_params += parse_form({'category': category})
        if contextlevel is not None:
            _form_params += parse_form({'contextlevel': contextlevel})
        if override is not None:
            _form_params += parse_form({'override': override})
        if purpose is not None:
            _form_params += parse_form({'purpose': purpose})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_set_context_form_args(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The context level data, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Sets purpose and category for a specific context

        Sets purpose and category for a specific context

        :param jsonformdata: The context level data, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_set_context_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySetContextFormResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_set_context_form(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The context level data, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacySetContextFormResponse:
        """Sets purpose and category for a specific context

        Sets purpose and category for a specific context

        :param jsonformdata: The context level data, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_set_context_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySetContextFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_set_context_form_from_args(
        self,
        args
    ) -> ToolDataprivacySetContextFormResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySetContextFormResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_set_context_form_with_http_info(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The context level data, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacySetContextFormResponse]:
        """Sets purpose and category for a specific context

        Sets purpose and category for a specific context

        :param jsonformdata: The context level data, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_set_context_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySetContextFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_set_context_form_without_preload_content(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The context level data, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Sets purpose and category for a specific context

        Sets purpose and category for a specific context

        :param jsonformdata: The context level data, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_set_context_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySetContextFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_set_context_form_serialize(
        self,
        jsonformdata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_set_context_form'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_set_context_form'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_set_context_form',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if jsonformdata is not None:
            _form_params += parse_form({'jsonformdata': jsonformdata})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_set_contextlevel_form_args(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The context level data, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Sets purpose and category across a context level

        Sets purpose and category across a context level

        :param jsonformdata: The context level data, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_set_contextlevel_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySetContextlevelFormResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_set_contextlevel_form(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The context level data, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacySetContextlevelFormResponse:
        """Sets purpose and category across a context level

        Sets purpose and category across a context level

        :param jsonformdata: The context level data, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_set_contextlevel_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySetContextlevelFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_set_contextlevel_form_from_args(
        self,
        args
    ) -> ToolDataprivacySetContextlevelFormResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySetContextlevelFormResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_set_contextlevel_form_with_http_info(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The context level data, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacySetContextlevelFormResponse]:
        """Sets purpose and category across a context level

        Sets purpose and category across a context level

        :param jsonformdata: The context level data, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_set_contextlevel_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySetContextlevelFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_set_contextlevel_form_without_preload_content(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The context level data, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Sets purpose and category across a context level

        Sets purpose and category across a context level

        :param jsonformdata: The context level data, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_set_contextlevel_form_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySetContextlevelFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_set_contextlevel_form_serialize(
        self,
        jsonformdata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_set_contextlevel_form'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_set_contextlevel_form'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_set_contextlevel_form',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if jsonformdata is not None:
            _form_params += parse_form({'jsonformdata': jsonformdata})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_submit_selected_courses_form_args(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data of selected courses form, encoded as a json array")],
        requestid: Annotated[Optional[StrictInt], Field(description="The id of data request")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Save list of selected courses for export

        Save list of selected courses for export

        :param jsonformdata: The data of selected courses form, encoded as a json array (required)
        :type jsonformdata: str
        :param requestid: The id of data request (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_submit_selected_courses_form_serialize(
            jsonformdata=jsonformdata,
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySubmitSelectedCoursesFormResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_submit_selected_courses_form(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data of selected courses form, encoded as a json array")],
        requestid: Annotated[Optional[StrictInt], Field(description="The id of data request")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacySubmitSelectedCoursesFormResponse:
        """Save list of selected courses for export

        Save list of selected courses for export

        :param jsonformdata: The data of selected courses form, encoded as a json array (required)
        :type jsonformdata: str
        :param requestid: The id of data request (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_submit_selected_courses_form_serialize(
            jsonformdata=jsonformdata,
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySubmitSelectedCoursesFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_submit_selected_courses_form_from_args(
        self,
        args
    ) -> ToolDataprivacySubmitSelectedCoursesFormResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySubmitSelectedCoursesFormResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_submit_selected_courses_form_with_http_info(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data of selected courses form, encoded as a json array")],
        requestid: Annotated[Optional[StrictInt], Field(description="The id of data request")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacySubmitSelectedCoursesFormResponse]:
        """Save list of selected courses for export

        Save list of selected courses for export

        :param jsonformdata: The data of selected courses form, encoded as a json array (required)
        :type jsonformdata: str
        :param requestid: The id of data request (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_submit_selected_courses_form_serialize(
            jsonformdata=jsonformdata,
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySubmitSelectedCoursesFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_submit_selected_courses_form_without_preload_content(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data of selected courses form, encoded as a json array")],
        requestid: Annotated[Optional[StrictInt], Field(description="The id of data request")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Save list of selected courses for export

        Save list of selected courses for export

        :param jsonformdata: The data of selected courses form, encoded as a json array (required)
        :type jsonformdata: str
        :param requestid: The id of data request (required)
        :type requestid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_submit_selected_courses_form_serialize(
            jsonformdata=jsonformdata,
            requestid=requestid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacySubmitSelectedCoursesFormResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_submit_selected_courses_form_serialize(
        self,
        jsonformdata,
        requestid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_submit_selected_courses_form'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_submit_selected_courses_form'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_submit_selected_courses_form',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if jsonformdata is not None:
            _form_params += parse_form({'jsonformdata': jsonformdata})
        if requestid is not None:
            _form_params += parse_form({'requestid': requestid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_dataprivacy_tree_extra_branches_args(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context id to expand")],
        element: Annotated[Optional[StrictStr], Field(description="The element we are interested on")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Return branches for the context tree

        Return branches for the context tree

        :param contextid: The context id to expand (required)
        :type contextid: int
        :param element: The element we are interested on (required)
        :type element: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_tree_extra_branches_serialize(
            contextid=contextid,
            element=element,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyTreeExtraBranchesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_dataprivacy_tree_extra_branches(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context id to expand")],
        element: Annotated[Optional[StrictStr], Field(description="The element we are interested on")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolDataprivacyTreeExtraBranchesResponse:
        """Return branches for the context tree

        Return branches for the context tree

        :param contextid: The context id to expand (required)
        :type contextid: int
        :param element: The element we are interested on (required)
        :type element: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_tree_extra_branches_serialize(
            contextid=contextid,
            element=element,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyTreeExtraBranchesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_tree_extra_branches_from_args(
        self,
        args
    ) -> ToolDataprivacyTreeExtraBranchesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyTreeExtraBranchesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_dataprivacy_tree_extra_branches_with_http_info(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context id to expand")],
        element: Annotated[Optional[StrictStr], Field(description="The element we are interested on")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolDataprivacyTreeExtraBranchesResponse]:
        """Return branches for the context tree

        Return branches for the context tree

        :param contextid: The context id to expand (required)
        :type contextid: int
        :param element: The element we are interested on (required)
        :type element: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_tree_extra_branches_serialize(
            contextid=contextid,
            element=element,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyTreeExtraBranchesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_dataprivacy_tree_extra_branches_without_preload_content(
        self,
        contextid: Annotated[Optional[StrictInt], Field(description="The context id to expand")],
        element: Annotated[Optional[StrictStr], Field(description="The element we are interested on")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Return branches for the context tree

        Return branches for the context tree

        :param contextid: The context id to expand (required)
        :type contextid: int
        :param element: The element we are interested on (required)
        :type element: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_dataprivacy_tree_extra_branches_serialize(
            contextid=contextid,
            element=element,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolDataprivacyTreeExtraBranchesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_dataprivacy_tree_extra_branches_serialize(
        self,
        contextid,
        element,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_dataprivacy_tree_extra_branches'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_dataprivacy_tree_extra_branches'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_dataprivacy_tree_extra_branches',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if contextid is not None:
            _form_params += parse_form({'contextid': contextid})
        if element is not None:
            _form_params += parse_form({'element': element})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_data_for_competencies_manage_page_args(
        self,
        competencyframeworkid: Annotated[Optional[StrictInt], Field(description="The competency framework id")],
        search: Annotated[Optional[StrictStr], Field(description="A search string")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load the data for the competencies manage page template

        Load the data for the competencies manage page template

        :param competencyframeworkid: The competency framework id (required)
        :type competencyframeworkid: int
        :param search: A search string
        :type search: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_competencies_manage_page_serialize(
            competencyframeworkid=competencyframeworkid,
            search=search,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCompetenciesManagePageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_data_for_competencies_manage_page(
        self,
        competencyframeworkid: Annotated[Optional[StrictInt], Field(description="The competency framework id")],
        search: Annotated[Optional[StrictStr], Field(description="A search string")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolLpDataForCompetenciesManagePageResponse:
        """Load the data for the competencies manage page template

        Load the data for the competencies manage page template

        :param competencyframeworkid: The competency framework id (required)
        :type competencyframeworkid: int
        :param search: A search string
        :type search: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_competencies_manage_page_serialize(
            competencyframeworkid=competencyframeworkid,
            search=search,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCompetenciesManagePageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_competencies_manage_page_from_args(
        self,
        args
    ) -> ToolLpDataForCompetenciesManagePageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCompetenciesManagePageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_competencies_manage_page_with_http_info(
        self,
        competencyframeworkid: Annotated[Optional[StrictInt], Field(description="The competency framework id")],
        search: Annotated[Optional[StrictStr], Field(description="A search string")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolLpDataForCompetenciesManagePageResponse]:
        """Load the data for the competencies manage page template

        Load the data for the competencies manage page template

        :param competencyframeworkid: The competency framework id (required)
        :type competencyframeworkid: int
        :param search: A search string
        :type search: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_competencies_manage_page_serialize(
            competencyframeworkid=competencyframeworkid,
            search=search,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCompetenciesManagePageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_data_for_competencies_manage_page_without_preload_content(
        self,
        competencyframeworkid: Annotated[Optional[StrictInt], Field(description="The competency framework id")],
        search: Annotated[Optional[StrictStr], Field(description="A search string")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load the data for the competencies manage page template

        Load the data for the competencies manage page template

        :param competencyframeworkid: The competency framework id (required)
        :type competencyframeworkid: int
        :param search: A search string
        :type search: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_competencies_manage_page_serialize(
            competencyframeworkid=competencyframeworkid,
            search=search,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCompetenciesManagePageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_data_for_competencies_manage_page_serialize(
        self,
        competencyframeworkid,
        search,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_data_for_competencies_manage_page'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_data_for_competencies_manage_page'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_data_for_competencies_manage_page',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyframeworkid is not None:
            _form_params += parse_form({'competencyframeworkid': competencyframeworkid})
        if search is not None:
            _form_params += parse_form({'search': search})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_data_for_competency_frameworks_manage_page_args(
        self,
        pagecontext: CoreCohortSearchCohortsParametersContext,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load the data for the competency frameworks manage page template

        Load the data for the competency frameworks manage page template

        :param pagecontext: (required)
        :type pagecontext: CoreCohortSearchCohortsParametersContext
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_competency_frameworks_manage_page_serialize(
            pagecontext=pagecontext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCompetencyFrameworksManagePageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_data_for_competency_frameworks_manage_page(
        self,
        pagecontext: CoreCohortSearchCohortsParametersContext,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolLpDataForCompetencyFrameworksManagePageResponse:
        """Load the data for the competency frameworks manage page template

        Load the data for the competency frameworks manage page template

        :param pagecontext: (required)
        :type pagecontext: CoreCohortSearchCohortsParametersContext
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_competency_frameworks_manage_page_serialize(
            pagecontext=pagecontext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCompetencyFrameworksManagePageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_competency_frameworks_manage_page_from_args(
        self,
        args
    ) -> ToolLpDataForCompetencyFrameworksManagePageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCompetencyFrameworksManagePageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_competency_frameworks_manage_page_with_http_info(
        self,
        pagecontext: CoreCohortSearchCohortsParametersContext,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolLpDataForCompetencyFrameworksManagePageResponse]:
        """Load the data for the competency frameworks manage page template

        Load the data for the competency frameworks manage page template

        :param pagecontext: (required)
        :type pagecontext: CoreCohortSearchCohortsParametersContext
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_competency_frameworks_manage_page_serialize(
            pagecontext=pagecontext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCompetencyFrameworksManagePageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_data_for_competency_frameworks_manage_page_without_preload_content(
        self,
        pagecontext: CoreCohortSearchCohortsParametersContext,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load the data for the competency frameworks manage page template

        Load the data for the competency frameworks manage page template

        :param pagecontext: (required)
        :type pagecontext: CoreCohortSearchCohortsParametersContext
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_competency_frameworks_manage_page_serialize(
            pagecontext=pagecontext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCompetencyFrameworksManagePageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_data_for_competency_frameworks_manage_page_serialize(
        self,
        pagecontext,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_data_for_competency_frameworks_manage_page'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_data_for_competency_frameworks_manage_page'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_data_for_competency_frameworks_manage_page',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if pagecontext is not None:
            _form_params += parse_form({'pagecontext': pagecontext})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_data_for_competency_summary_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        includecourses: Annotated[Optional[StrictBool], Field(description="Include or not competency courses")] = None,
        includerelated: Annotated[Optional[StrictBool], Field(description="Include or not related competencies")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load competency data for summary template.

        Load competency data for summary template.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param includecourses: Include or not competency courses
        :type includecourses: bool
        :param includerelated: Include or not related competencies
        :type includerelated: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_competency_summary_serialize(
            competencyid=competencyid,
            includecourses=includecourses,
            includerelated=includerelated,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCompetencySummaryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_data_for_competency_summary(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        includecourses: Annotated[Optional[StrictBool], Field(description="Include or not competency courses")] = None,
        includerelated: Annotated[Optional[StrictBool], Field(description="Include or not related competencies")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolLpDataForCompetencySummaryResponse:
        """Load competency data for summary template.

        Load competency data for summary template.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param includecourses: Include or not competency courses
        :type includecourses: bool
        :param includerelated: Include or not related competencies
        :type includerelated: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_competency_summary_serialize(
            competencyid=competencyid,
            includecourses=includecourses,
            includerelated=includerelated,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCompetencySummaryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_competency_summary_from_args(
        self,
        args
    ) -> ToolLpDataForCompetencySummaryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCompetencySummaryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_competency_summary_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        includecourses: Annotated[Optional[StrictBool], Field(description="Include or not competency courses")] = None,
        includerelated: Annotated[Optional[StrictBool], Field(description="Include or not related competencies")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolLpDataForCompetencySummaryResponse]:
        """Load competency data for summary template.

        Load competency data for summary template.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param includecourses: Include or not competency courses
        :type includecourses: bool
        :param includerelated: Include or not related competencies
        :type includerelated: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_competency_summary_serialize(
            competencyid=competencyid,
            includecourses=includecourses,
            includerelated=includerelated,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCompetencySummaryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_data_for_competency_summary_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        includecourses: Annotated[Optional[StrictBool], Field(description="Include or not competency courses")] = None,
        includerelated: Annotated[Optional[StrictBool], Field(description="Include or not related competencies")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load competency data for summary template.

        Load competency data for summary template.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param includecourses: Include or not competency courses
        :type includecourses: bool
        :param includerelated: Include or not related competencies
        :type includerelated: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_competency_summary_serialize(
            competencyid=competencyid,
            includecourses=includecourses,
            includerelated=includerelated,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCompetencySummaryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_data_for_competency_summary_serialize(
        self,
        competencyid,
        includecourses,
        includerelated,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_data_for_competency_summary'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_data_for_competency_summary'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_data_for_competency_summary',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if includecourses is not None:
            _form_params += parse_form({'includecourses': includecourses})
        if includerelated is not None:
            _form_params += parse_form({'includerelated': includerelated})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_data_for_course_competencies_page_args(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        moduleid: Annotated[Optional[StrictInt], Field(description="The module id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load the data for the course competencies page template.

        Load the data for the course competencies page template.

        :param courseid: The course id (required)
        :type courseid: int
        :param moduleid: The module id
        :type moduleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_course_competencies_page_serialize(
            courseid=courseid,
            moduleid=moduleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCourseCompetenciesPageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_data_for_course_competencies_page(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        moduleid: Annotated[Optional[StrictInt], Field(description="The module id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolLpDataForCourseCompetenciesPageResponse:
        """Load the data for the course competencies page template.

        Load the data for the course competencies page template.

        :param courseid: The course id (required)
        :type courseid: int
        :param moduleid: The module id
        :type moduleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_course_competencies_page_serialize(
            courseid=courseid,
            moduleid=moduleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCourseCompetenciesPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_course_competencies_page_from_args(
        self,
        args
    ) -> ToolLpDataForCourseCompetenciesPageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCourseCompetenciesPageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_course_competencies_page_with_http_info(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        moduleid: Annotated[Optional[StrictInt], Field(description="The module id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolLpDataForCourseCompetenciesPageResponse]:
        """Load the data for the course competencies page template.

        Load the data for the course competencies page template.

        :param courseid: The course id (required)
        :type courseid: int
        :param moduleid: The module id
        :type moduleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_course_competencies_page_serialize(
            courseid=courseid,
            moduleid=moduleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCourseCompetenciesPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_data_for_course_competencies_page_without_preload_content(
        self,
        courseid: Annotated[Optional[StrictInt], Field(description="The course id")],
        moduleid: Annotated[Optional[StrictInt], Field(description="The module id")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load the data for the course competencies page template.

        Load the data for the course competencies page template.

        :param courseid: The course id (required)
        :type courseid: int
        :param moduleid: The module id
        :type moduleid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_course_competencies_page_serialize(
            courseid=courseid,
            moduleid=moduleid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForCourseCompetenciesPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_data_for_course_competencies_page_serialize(
        self,
        courseid,
        moduleid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_data_for_course_competencies_page'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_data_for_course_competencies_page'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_data_for_course_competencies_page',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if moduleid is not None:
            _form_params += parse_form({'moduleid': moduleid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_data_for_plan_page_args(
        self,
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load the data for the plan page template.

        Load the data for the plan page template.

        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_plan_page_serialize(
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForPlanPageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_data_for_plan_page(
        self,
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolLpDataForPlanPageResponse:
        """Load the data for the plan page template.

        Load the data for the plan page template.

        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_plan_page_serialize(
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForPlanPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_plan_page_from_args(
        self,
        args
    ) -> ToolLpDataForPlanPageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForPlanPageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_plan_page_with_http_info(
        self,
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolLpDataForPlanPageResponse]:
        """Load the data for the plan page template.

        Load the data for the plan page template.

        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_plan_page_serialize(
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForPlanPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_data_for_plan_page_without_preload_content(
        self,
        planid: Annotated[Optional[StrictInt], Field(description="The plan id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load the data for the plan page template.

        Load the data for the plan page template.

        :param planid: The plan id (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_plan_page_serialize(
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForPlanPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_data_for_plan_page_serialize(
        self,
        planid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_data_for_plan_page'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_data_for_plan_page'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_data_for_plan_page',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if planid is not None:
            _form_params += parse_form({'planid': planid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_data_for_plans_page_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load the data for the plans page template

        Load the data for the plans page template

        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_plans_page_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForPlansPageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_data_for_plans_page(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolLpDataForPlansPageResponse:
        """Load the data for the plans page template

        Load the data for the plans page template

        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_plans_page_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForPlansPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_plans_page_from_args(
        self,
        args
    ) -> ToolLpDataForPlansPageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForPlansPageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_plans_page_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolLpDataForPlansPageResponse]:
        """Load the data for the plans page template

        Load the data for the plans page template

        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_plans_page_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForPlansPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_data_for_plans_page_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load the data for the plans page template

        Load the data for the plans page template

        :param userid: The user id (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_plans_page_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForPlansPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_data_for_plans_page_serialize(
        self,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_data_for_plans_page'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_data_for_plans_page'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_data_for_plans_page',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_data_for_related_competencies_section_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load the data for the related competencies template.

        Load the data for the related competencies template.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_related_competencies_section_serialize(
            competencyid=competencyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForRelatedCompetenciesSectionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_data_for_related_competencies_section(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolLpDataForRelatedCompetenciesSectionResponse:
        """Load the data for the related competencies template.

        Load the data for the related competencies template.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_related_competencies_section_serialize(
            competencyid=competencyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForRelatedCompetenciesSectionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_related_competencies_section_from_args(
        self,
        args
    ) -> ToolLpDataForRelatedCompetenciesSectionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForRelatedCompetenciesSectionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_related_competencies_section_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolLpDataForRelatedCompetenciesSectionResponse]:
        """Load the data for the related competencies template.

        Load the data for the related competencies template.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_related_competencies_section_serialize(
            competencyid=competencyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForRelatedCompetenciesSectionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_data_for_related_competencies_section_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load the data for the related competencies template.

        Load the data for the related competencies template.

        :param competencyid: The competency id (required)
        :type competencyid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_related_competencies_section_serialize(
            competencyid=competencyid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForRelatedCompetenciesSectionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_data_for_related_competencies_section_serialize(
        self,
        competencyid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_data_for_related_competencies_section'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_data_for_related_competencies_section'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_data_for_related_competencies_section',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_data_for_template_competencies_page_args(
        self,
        pagecontext: CoreCohortSearchCohortsParametersContext,
        templateid: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load the data for the template competencies page template.

        Load the data for the template competencies page template.

        :param pagecontext: (required)
        :type pagecontext: CoreCohortSearchCohortsParametersContext
        :param templateid: The template id (required)
        :type templateid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_template_competencies_page_serialize(
            pagecontext=pagecontext,
            templateid=templateid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForTemplateCompetenciesPageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_data_for_template_competencies_page(
        self,
        pagecontext: CoreCohortSearchCohortsParametersContext,
        templateid: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolLpDataForTemplateCompetenciesPageResponse:
        """Load the data for the template competencies page template.

        Load the data for the template competencies page template.

        :param pagecontext: (required)
        :type pagecontext: CoreCohortSearchCohortsParametersContext
        :param templateid: The template id (required)
        :type templateid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_template_competencies_page_serialize(
            pagecontext=pagecontext,
            templateid=templateid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForTemplateCompetenciesPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_template_competencies_page_from_args(
        self,
        args
    ) -> ToolLpDataForTemplateCompetenciesPageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForTemplateCompetenciesPageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_template_competencies_page_with_http_info(
        self,
        pagecontext: CoreCohortSearchCohortsParametersContext,
        templateid: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolLpDataForTemplateCompetenciesPageResponse]:
        """Load the data for the template competencies page template.

        Load the data for the template competencies page template.

        :param pagecontext: (required)
        :type pagecontext: CoreCohortSearchCohortsParametersContext
        :param templateid: The template id (required)
        :type templateid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_template_competencies_page_serialize(
            pagecontext=pagecontext,
            templateid=templateid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForTemplateCompetenciesPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_data_for_template_competencies_page_without_preload_content(
        self,
        pagecontext: CoreCohortSearchCohortsParametersContext,
        templateid: Annotated[Optional[StrictInt], Field(description="The template id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load the data for the template competencies page template.

        Load the data for the template competencies page template.

        :param pagecontext: (required)
        :type pagecontext: CoreCohortSearchCohortsParametersContext
        :param templateid: The template id (required)
        :type templateid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_template_competencies_page_serialize(
            pagecontext=pagecontext,
            templateid=templateid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForTemplateCompetenciesPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_data_for_template_competencies_page_serialize(
        self,
        pagecontext,
        templateid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_data_for_template_competencies_page'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_data_for_template_competencies_page'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_data_for_template_competencies_page',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if pagecontext is not None:
            _form_params += parse_form({'pagecontext': pagecontext})
        if templateid is not None:
            _form_params += parse_form({'templateid': templateid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_data_for_templates_manage_page_args(
        self,
        pagecontext: CoreCohortSearchCohortsParametersContext,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load the data for the learning plan templates manage page template

        Load the data for the learning plan templates manage page template

        :param pagecontext: (required)
        :type pagecontext: CoreCohortSearchCohortsParametersContext
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_templates_manage_page_serialize(
            pagecontext=pagecontext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForTemplatesManagePageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_data_for_templates_manage_page(
        self,
        pagecontext: CoreCohortSearchCohortsParametersContext,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolLpDataForTemplatesManagePageResponse:
        """Load the data for the learning plan templates manage page template

        Load the data for the learning plan templates manage page template

        :param pagecontext: (required)
        :type pagecontext: CoreCohortSearchCohortsParametersContext
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_templates_manage_page_serialize(
            pagecontext=pagecontext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForTemplatesManagePageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_templates_manage_page_from_args(
        self,
        args
    ) -> ToolLpDataForTemplatesManagePageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForTemplatesManagePageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_templates_manage_page_with_http_info(
        self,
        pagecontext: CoreCohortSearchCohortsParametersContext,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolLpDataForTemplatesManagePageResponse]:
        """Load the data for the learning plan templates manage page template

        Load the data for the learning plan templates manage page template

        :param pagecontext: (required)
        :type pagecontext: CoreCohortSearchCohortsParametersContext
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_templates_manage_page_serialize(
            pagecontext=pagecontext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForTemplatesManagePageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_data_for_templates_manage_page_without_preload_content(
        self,
        pagecontext: CoreCohortSearchCohortsParametersContext,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load the data for the learning plan templates manage page template

        Load the data for the learning plan templates manage page template

        :param pagecontext: (required)
        :type pagecontext: CoreCohortSearchCohortsParametersContext
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_templates_manage_page_serialize(
            pagecontext=pagecontext,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForTemplatesManagePageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_data_for_templates_manage_page_serialize(
        self,
        pagecontext,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_data_for_templates_manage_page'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_data_for_templates_manage_page'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_data_for_templates_manage_page',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if pagecontext is not None:
            _form_params += parse_form({'pagecontext': pagecontext})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_data_for_user_competency_summary_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        userid: Annotated[Optional[StrictInt], Field(description="Data base record id for the user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load a summary of a user competency.

        Load a summary of a user competency.

        :param competencyid: Data base record id for the competency (required)
        :type competencyid: int
        :param userid: Data base record id for the user (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_competency_summary_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserCompetencySummaryResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_data_for_user_competency_summary(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        userid: Annotated[Optional[StrictInt], Field(description="Data base record id for the user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolLpDataForUserCompetencySummaryResponse:
        """Load a summary of a user competency.

        Load a summary of a user competency.

        :param competencyid: Data base record id for the competency (required)
        :type competencyid: int
        :param userid: Data base record id for the user (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_competency_summary_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserCompetencySummaryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_user_competency_summary_from_args(
        self,
        args
    ) -> ToolLpDataForUserCompetencySummaryResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserCompetencySummaryResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_user_competency_summary_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        userid: Annotated[Optional[StrictInt], Field(description="Data base record id for the user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolLpDataForUserCompetencySummaryResponse]:
        """Load a summary of a user competency.

        Load a summary of a user competency.

        :param competencyid: Data base record id for the competency (required)
        :type competencyid: int
        :param userid: Data base record id for the user (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_competency_summary_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserCompetencySummaryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_data_for_user_competency_summary_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        userid: Annotated[Optional[StrictInt], Field(description="Data base record id for the user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load a summary of a user competency.

        Load a summary of a user competency.

        :param competencyid: Data base record id for the competency (required)
        :type competencyid: int
        :param userid: Data base record id for the user (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_competency_summary_serialize(
            competencyid=competencyid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserCompetencySummaryResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_data_for_user_competency_summary_serialize(
        self,
        competencyid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_data_for_user_competency_summary'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_data_for_user_competency_summary'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_data_for_user_competency_summary',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_data_for_user_competency_summary_in_course_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        courseid: Annotated[Optional[StrictInt], Field(description="Data base record id for the course")],
        userid: Annotated[Optional[StrictInt], Field(description="Data base record id for the user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load a summary of a user competency.

        Load a summary of a user competency.

        :param competencyid: Data base record id for the competency (required)
        :type competencyid: int
        :param courseid: Data base record id for the course (required)
        :type courseid: int
        :param userid: Data base record id for the user (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_competency_summary_in_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserCompetencySummaryInCourseResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_data_for_user_competency_summary_in_course(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        courseid: Annotated[Optional[StrictInt], Field(description="Data base record id for the course")],
        userid: Annotated[Optional[StrictInt], Field(description="Data base record id for the user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolLpDataForUserCompetencySummaryInCourseResponse:
        """Load a summary of a user competency.

        Load a summary of a user competency.

        :param competencyid: Data base record id for the competency (required)
        :type competencyid: int
        :param courseid: Data base record id for the course (required)
        :type courseid: int
        :param userid: Data base record id for the user (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_competency_summary_in_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserCompetencySummaryInCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_user_competency_summary_in_course_from_args(
        self,
        args
    ) -> ToolLpDataForUserCompetencySummaryInCourseResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserCompetencySummaryInCourseResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_user_competency_summary_in_course_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        courseid: Annotated[Optional[StrictInt], Field(description="Data base record id for the course")],
        userid: Annotated[Optional[StrictInt], Field(description="Data base record id for the user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolLpDataForUserCompetencySummaryInCourseResponse]:
        """Load a summary of a user competency.

        Load a summary of a user competency.

        :param competencyid: Data base record id for the competency (required)
        :type competencyid: int
        :param courseid: Data base record id for the course (required)
        :type courseid: int
        :param userid: Data base record id for the user (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_competency_summary_in_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserCompetencySummaryInCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_data_for_user_competency_summary_in_course_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        courseid: Annotated[Optional[StrictInt], Field(description="Data base record id for the course")],
        userid: Annotated[Optional[StrictInt], Field(description="Data base record id for the user")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load a summary of a user competency.

        Load a summary of a user competency.

        :param competencyid: Data base record id for the competency (required)
        :type competencyid: int
        :param courseid: Data base record id for the course (required)
        :type courseid: int
        :param userid: Data base record id for the user (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_competency_summary_in_course_serialize(
            competencyid=competencyid,
            courseid=courseid,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserCompetencySummaryInCourseResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_data_for_user_competency_summary_in_course_serialize(
        self,
        competencyid,
        courseid,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_data_for_user_competency_summary_in_course'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_data_for_user_competency_summary_in_course'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_data_for_user_competency_summary_in_course',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if courseid is not None:
            _form_params += parse_form({'courseid': courseid})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_data_for_user_competency_summary_in_plan_args(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        planid: Annotated[Optional[StrictInt], Field(description="Data base record id for the plan")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load a summary of a user competency.

        Load a summary of a user competency.

        :param competencyid: Data base record id for the competency (required)
        :type competencyid: int
        :param planid: Data base record id for the plan (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_competency_summary_in_plan_serialize(
            competencyid=competencyid,
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserCompetencySummaryInPlanResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_data_for_user_competency_summary_in_plan(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        planid: Annotated[Optional[StrictInt], Field(description="Data base record id for the plan")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolLpDataForUserCompetencySummaryInPlanResponse:
        """Load a summary of a user competency.

        Load a summary of a user competency.

        :param competencyid: Data base record id for the competency (required)
        :type competencyid: int
        :param planid: Data base record id for the plan (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_competency_summary_in_plan_serialize(
            competencyid=competencyid,
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserCompetencySummaryInPlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_user_competency_summary_in_plan_from_args(
        self,
        args
    ) -> ToolLpDataForUserCompetencySummaryInPlanResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserCompetencySummaryInPlanResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_user_competency_summary_in_plan_with_http_info(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        planid: Annotated[Optional[StrictInt], Field(description="Data base record id for the plan")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolLpDataForUserCompetencySummaryInPlanResponse]:
        """Load a summary of a user competency.

        Load a summary of a user competency.

        :param competencyid: Data base record id for the competency (required)
        :type competencyid: int
        :param planid: Data base record id for the plan (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_competency_summary_in_plan_serialize(
            competencyid=competencyid,
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserCompetencySummaryInPlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_data_for_user_competency_summary_in_plan_without_preload_content(
        self,
        competencyid: Annotated[Optional[StrictInt], Field(description="Data base record id for the competency")],
        planid: Annotated[Optional[StrictInt], Field(description="Data base record id for the plan")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load a summary of a user competency.

        Load a summary of a user competency.

        :param competencyid: Data base record id for the competency (required)
        :type competencyid: int
        :param planid: Data base record id for the plan (required)
        :type planid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_competency_summary_in_plan_serialize(
            competencyid=competencyid,
            planid=planid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserCompetencySummaryInPlanResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_data_for_user_competency_summary_in_plan_serialize(
        self,
        competencyid,
        planid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_data_for_user_competency_summary_in_plan'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_data_for_user_competency_summary_in_plan'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_data_for_user_competency_summary_in_plan',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if competencyid is not None:
            _form_params += parse_form({'competencyid': competencyid})
        if planid is not None:
            _form_params += parse_form({'planid': planid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_data_for_user_evidence_list_page_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load the data for the user evidence list page template

        Load the data for the user evidence list page template

        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_evidence_list_page_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserEvidenceListPageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_data_for_user_evidence_list_page(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolLpDataForUserEvidenceListPageResponse:
        """Load the data for the user evidence list page template

        Load the data for the user evidence list page template

        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_evidence_list_page_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserEvidenceListPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_user_evidence_list_page_from_args(
        self,
        args
    ) -> ToolLpDataForUserEvidenceListPageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserEvidenceListPageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_user_evidence_list_page_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolLpDataForUserEvidenceListPageResponse]:
        """Load the data for the user evidence list page template

        Load the data for the user evidence list page template

        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_evidence_list_page_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserEvidenceListPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_data_for_user_evidence_list_page_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load the data for the user evidence list page template

        Load the data for the user evidence list page template

        :param userid: The user ID (required)
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_evidence_list_page_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserEvidenceListPageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_data_for_user_evidence_list_page_serialize(
        self,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_data_for_user_evidence_list_page'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_data_for_user_evidence_list_page'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_data_for_user_evidence_list_page',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_data_for_user_evidence_page_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The user evidence ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load the data for the user evidence page template

        Load the data for the user evidence page template

        :param id: The user evidence ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_evidence_page_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserEvidencePageResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_data_for_user_evidence_page(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The user evidence ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolLpDataForUserEvidencePageResponse:
        """Load the data for the user evidence page template

        Load the data for the user evidence page template

        :param id: The user evidence ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_evidence_page_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserEvidencePageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_user_evidence_page_from_args(
        self,
        args
    ) -> ToolLpDataForUserEvidencePageResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserEvidencePageResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_data_for_user_evidence_page_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The user evidence ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolLpDataForUserEvidencePageResponse]:
        """Load the data for the user evidence page template

        Load the data for the user evidence page template

        :param id: The user evidence ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_evidence_page_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserEvidencePageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_data_for_user_evidence_page_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The user evidence ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load the data for the user evidence page template

        Load the data for the user evidence page template

        :param id: The user evidence ID (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_data_for_user_evidence_page_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpDataForUserEvidencePageResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_data_for_user_evidence_page_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_data_for_user_evidence_page'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_data_for_user_evidence_page'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_data_for_user_evidence_page',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_list_courses_using_competency_args(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """List the courses using a competency

        List the courses using a competency

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_list_courses_using_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockStarredcoursesGetStarredCoursesResponseInner]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_list_courses_using_competency(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[BlockStarredcoursesGetStarredCoursesResponseInner]:
        """List the courses using a competency

        List the courses using a competency

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_list_courses_using_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockStarredcoursesGetStarredCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_list_courses_using_competency_from_args(
        self,
        args
    ) -> List[BlockStarredcoursesGetStarredCoursesResponseInner]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockStarredcoursesGetStarredCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_list_courses_using_competency_with_http_info(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[BlockStarredcoursesGetStarredCoursesResponseInner]]:
        """List the courses using a competency

        List the courses using a competency

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_list_courses_using_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockStarredcoursesGetStarredCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_list_courses_using_competency_without_preload_content(
        self,
        id: Annotated[Optional[StrictInt], Field(description="The competency id")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List the courses using a competency

        List the courses using a competency

        :param id: The competency id (required)
        :type id: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_list_courses_using_competency_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[BlockStarredcoursesGetStarredCoursesResponseInner]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_list_courses_using_competency_serialize(
        self,
        id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_list_courses_using_competency'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_list_courses_using_competency'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_list_courses_using_competency',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if id is not None:
            _form_params += parse_form({'id': id})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_search_cohorts_args(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        query: Annotated[Optional[StrictStr], Field(description="Query string")],
        includes: Annotated[Optional[StrictStr], Field(description="What other contexts to fetch the frameworks from. (all, parents, self)")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="limitfrom we are fetching the records from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Number of records to fetch")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Search for cohorts. This method is deprecated, please call 'core_cohort_search_cohorts' instead

        Search for cohorts. This method is deprecated, please call 'core_cohort_search_cohorts' instead

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param query: Query string (required)
        :type query: str
        :param includes: What other contexts to fetch the frameworks from. (all, parents, self)
        :type includes: str
        :param limitfrom: limitfrom we are fetching the records from
        :type limitfrom: int
        :param limitnum: Number of records to fetch
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_search_cohorts_serialize(
            context=context,
            query=query,
            includes=includes,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpSearchCohortsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_search_cohorts(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        query: Annotated[Optional[StrictStr], Field(description="Query string")],
        includes: Annotated[Optional[StrictStr], Field(description="What other contexts to fetch the frameworks from. (all, parents, self)")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="limitfrom we are fetching the records from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Number of records to fetch")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolLpSearchCohortsResponse:
        """Search for cohorts. This method is deprecated, please call 'core_cohort_search_cohorts' instead

        Search for cohorts. This method is deprecated, please call 'core_cohort_search_cohorts' instead

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param query: Query string (required)
        :type query: str
        :param includes: What other contexts to fetch the frameworks from. (all, parents, self)
        :type includes: str
        :param limitfrom: limitfrom we are fetching the records from
        :type limitfrom: int
        :param limitnum: Number of records to fetch
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_search_cohorts_serialize(
            context=context,
            query=query,
            includes=includes,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpSearchCohortsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_search_cohorts_from_args(
        self,
        args
    ) -> ToolLpSearchCohortsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpSearchCohortsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_search_cohorts_with_http_info(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        query: Annotated[Optional[StrictStr], Field(description="Query string")],
        includes: Annotated[Optional[StrictStr], Field(description="What other contexts to fetch the frameworks from. (all, parents, self)")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="limitfrom we are fetching the records from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Number of records to fetch")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolLpSearchCohortsResponse]:
        """Search for cohorts. This method is deprecated, please call 'core_cohort_search_cohorts' instead

        Search for cohorts. This method is deprecated, please call 'core_cohort_search_cohorts' instead

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param query: Query string (required)
        :type query: str
        :param includes: What other contexts to fetch the frameworks from. (all, parents, self)
        :type includes: str
        :param limitfrom: limitfrom we are fetching the records from
        :type limitfrom: int
        :param limitnum: Number of records to fetch
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_search_cohorts_serialize(
            context=context,
            query=query,
            includes=includes,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpSearchCohortsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_search_cohorts_without_preload_content(
        self,
        context: CoreCohortSearchCohortsParametersContext,
        query: Annotated[Optional[StrictStr], Field(description="Query string")],
        includes: Annotated[Optional[StrictStr], Field(description="What other contexts to fetch the frameworks from. (all, parents, self)")] = None,
        limitfrom: Annotated[Optional[StrictInt], Field(description="limitfrom we are fetching the records from")] = None,
        limitnum: Annotated[Optional[StrictInt], Field(description="Number of records to fetch")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Search for cohorts. This method is deprecated, please call 'core_cohort_search_cohorts' instead

        Search for cohorts. This method is deprecated, please call 'core_cohort_search_cohorts' instead

        :param context: (required)
        :type context: CoreCohortSearchCohortsParametersContext
        :param query: Query string (required)
        :type query: str
        :param includes: What other contexts to fetch the frameworks from. (all, parents, self)
        :type includes: str
        :param limitfrom: limitfrom we are fetching the records from
        :type limitfrom: int
        :param limitnum: Number of records to fetch
        :type limitnum: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_search_cohorts_serialize(
            context=context,
            query=query,
            includes=includes,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpSearchCohortsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_search_cohorts_serialize(
        self,
        context,
        query,
        includes,
        limitfrom,
        limitnum,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_search_cohorts'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_search_cohorts'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_search_cohorts',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if context is not None:
            _form_params += parse_form({'context': context})
        if includes is not None:
            _form_params += parse_form({'includes': includes})
        if limitfrom is not None:
            _form_params += parse_form({'limitfrom': limitfrom})
        if limitnum is not None:
            _form_params += parse_form({'limitnum': limitnum})
        if query is not None:
            _form_params += parse_form({'query': query})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_lp_search_users_args(
        self,
        capability: Annotated[Optional[StrictStr], Field(description="Required capability")],
        query: Annotated[Optional[StrictStr], Field(description="Query string")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Number of records to skip")] = None,
        limitnum: Annotated[Optional[StrictStr], Field(description="Number of records to fetch")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Search for users.

        Search for users.

        :param capability: Required capability (required)
        :type capability: str
        :param query: Query string (required)
        :type query: str
        :param limitfrom: Number of records to skip
        :type limitfrom: int
        :param limitnum: Number of records to fetch
        :type limitnum: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_search_users_serialize(
            capability=capability,
            query=query,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpSearchUsersResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_lp_search_users(
        self,
        capability: Annotated[Optional[StrictStr], Field(description="Required capability")],
        query: Annotated[Optional[StrictStr], Field(description="Query string")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Number of records to skip")] = None,
        limitnum: Annotated[Optional[StrictStr], Field(description="Number of records to fetch")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolLpSearchUsersResponse:
        """Search for users.

        Search for users.

        :param capability: Required capability (required)
        :type capability: str
        :param query: Query string (required)
        :type query: str
        :param limitfrom: Number of records to skip
        :type limitfrom: int
        :param limitnum: Number of records to fetch
        :type limitnum: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_search_users_serialize(
            capability=capability,
            query=query,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpSearchUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_search_users_from_args(
        self,
        args
    ) -> ToolLpSearchUsersResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpSearchUsersResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_lp_search_users_with_http_info(
        self,
        capability: Annotated[Optional[StrictStr], Field(description="Required capability")],
        query: Annotated[Optional[StrictStr], Field(description="Query string")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Number of records to skip")] = None,
        limitnum: Annotated[Optional[StrictStr], Field(description="Number of records to fetch")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolLpSearchUsersResponse]:
        """Search for users.

        Search for users.

        :param capability: Required capability (required)
        :type capability: str
        :param query: Query string (required)
        :type query: str
        :param limitfrom: Number of records to skip
        :type limitfrom: int
        :param limitnum: Number of records to fetch
        :type limitnum: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_search_users_serialize(
            capability=capability,
            query=query,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpSearchUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_lp_search_users_without_preload_content(
        self,
        capability: Annotated[Optional[StrictStr], Field(description="Required capability")],
        query: Annotated[Optional[StrictStr], Field(description="Query string")],
        limitfrom: Annotated[Optional[StrictInt], Field(description="Number of records to skip")] = None,
        limitnum: Annotated[Optional[StrictStr], Field(description="Number of records to fetch")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Search for users.

        Search for users.

        :param capability: Required capability (required)
        :type capability: str
        :param query: Query string (required)
        :type query: str
        :param limitfrom: Number of records to skip
        :type limitfrom: int
        :param limitnum: Number of records to fetch
        :type limitnum: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_lp_search_users_serialize(
            capability=capability,
            query=query,
            limitfrom=limitfrom,
            limitnum=limitnum,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolLpSearchUsersResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_lp_search_users_serialize(
        self,
        capability,
        query,
        limitfrom,
        limitnum,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_lp_search_users'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_lp_search_users'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_lp_search_users',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if capability is not None:
            _form_params += parse_form({'capability': capability})
        if limitfrom is not None:
            _form_params += parse_form({'limitfrom': limitfrom})
        if limitnum is not None:
            _form_params += parse_form({'limitnum': limitnum})
        if query is not None:
            _form_params += parse_form({'query': query})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_mobile_call_external_functions_args(
        self,
        requests: List[ToolMobileCallExternalFunctionsParametersRequestsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Call multiple external functions and return all responses.

        Call multiple external functions and return all responses.

        :param requests: (required)
        :type requests: List[ToolMobileCallExternalFunctionsParametersRequestsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_call_external_functions_serialize(
            requests=requests,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileCallExternalFunctionsResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_mobile_call_external_functions(
        self,
        requests: List[ToolMobileCallExternalFunctionsParametersRequestsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolMobileCallExternalFunctionsResponse:
        """Call multiple external functions and return all responses.

        Call multiple external functions and return all responses.

        :param requests: (required)
        :type requests: List[ToolMobileCallExternalFunctionsParametersRequestsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_call_external_functions_serialize(
            requests=requests,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileCallExternalFunctionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_mobile_call_external_functions_from_args(
        self,
        args
    ) -> ToolMobileCallExternalFunctionsResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileCallExternalFunctionsResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_mobile_call_external_functions_with_http_info(
        self,
        requests: List[ToolMobileCallExternalFunctionsParametersRequestsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolMobileCallExternalFunctionsResponse]:
        """Call multiple external functions and return all responses.

        Call multiple external functions and return all responses.

        :param requests: (required)
        :type requests: List[ToolMobileCallExternalFunctionsParametersRequestsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_call_external_functions_serialize(
            requests=requests,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileCallExternalFunctionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_mobile_call_external_functions_without_preload_content(
        self,
        requests: List[ToolMobileCallExternalFunctionsParametersRequestsInner],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Call multiple external functions and return all responses.

        Call multiple external functions and return all responses.

        :param requests: (required)
        :type requests: List[ToolMobileCallExternalFunctionsParametersRequestsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_call_external_functions_serialize(
            requests=requests,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileCallExternalFunctionsResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_mobile_call_external_functions_serialize(
        self,
        requests,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'requests': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#tool_mobile_call_external_functions'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_mobile_call_external_functions'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_mobile_call_external_functions',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if requests is not None:
            _form_params += parse_form({'requests': requests})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_mobile_get_autologin_key_args(
        self,
        privatetoken: Annotated[Optional[StrictStr], Field(description="Private token, usually generated by login/token.php")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Creates an auto-login key for the current user.                             Is created only in https sites and is restricted by time, ip address and only works if the request                             comes from the Moodle mobile or desktop app.

        Creates an auto-login key for the current user.                             Is created only in https sites and is restricted by time, ip address and only works if the request                             comes from the Moodle mobile or desktop app.

        :param privatetoken: Private token, usually generated by login/token.php (required)
        :type privatetoken: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_autologin_key_serialize(
            privatetoken=privatetoken,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetAutologinKeyResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_mobile_get_autologin_key(
        self,
        privatetoken: Annotated[Optional[StrictStr], Field(description="Private token, usually generated by login/token.php")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolMobileGetAutologinKeyResponse:
        """Creates an auto-login key for the current user.                             Is created only in https sites and is restricted by time, ip address and only works if the request                             comes from the Moodle mobile or desktop app.

        Creates an auto-login key for the current user.                             Is created only in https sites and is restricted by time, ip address and only works if the request                             comes from the Moodle mobile or desktop app.

        :param privatetoken: Private token, usually generated by login/token.php (required)
        :type privatetoken: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_autologin_key_serialize(
            privatetoken=privatetoken,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetAutologinKeyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_mobile_get_autologin_key_from_args(
        self,
        args
    ) -> ToolMobileGetAutologinKeyResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetAutologinKeyResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_mobile_get_autologin_key_with_http_info(
        self,
        privatetoken: Annotated[Optional[StrictStr], Field(description="Private token, usually generated by login/token.php")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolMobileGetAutologinKeyResponse]:
        """Creates an auto-login key for the current user.                             Is created only in https sites and is restricted by time, ip address and only works if the request                             comes from the Moodle mobile or desktop app.

        Creates an auto-login key for the current user.                             Is created only in https sites and is restricted by time, ip address and only works if the request                             comes from the Moodle mobile or desktop app.

        :param privatetoken: Private token, usually generated by login/token.php (required)
        :type privatetoken: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_autologin_key_serialize(
            privatetoken=privatetoken,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetAutologinKeyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_mobile_get_autologin_key_without_preload_content(
        self,
        privatetoken: Annotated[Optional[StrictStr], Field(description="Private token, usually generated by login/token.php")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Creates an auto-login key for the current user.                             Is created only in https sites and is restricted by time, ip address and only works if the request                             comes from the Moodle mobile or desktop app.

        Creates an auto-login key for the current user.                             Is created only in https sites and is restricted by time, ip address and only works if the request                             comes from the Moodle mobile or desktop app.

        :param privatetoken: Private token, usually generated by login/token.php (required)
        :type privatetoken: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_autologin_key_serialize(
            privatetoken=privatetoken,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetAutologinKeyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_mobile_get_autologin_key_serialize(
        self,
        privatetoken,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_mobile_get_autologin_key'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_mobile_get_autologin_key'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_mobile_get_autologin_key',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if privatetoken is not None:
            _form_params += parse_form({'privatetoken': privatetoken})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_mobile_get_config_args(
        self,
        section: Annotated[Optional[StrictStr], Field(description="Settings section name.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of the site configurations, filtering by section.

        Returns a list of the site configurations, filtering by section.

        :param section: Settings section name.
        :type section: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_config_serialize(
            section=section,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetConfigResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_mobile_get_config(
        self,
        section: Annotated[Optional[StrictStr], Field(description="Settings section name.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolMobileGetConfigResponse:
        """Returns a list of the site configurations, filtering by section.

        Returns a list of the site configurations, filtering by section.

        :param section: Settings section name.
        :type section: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_config_serialize(
            section=section,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetConfigResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_mobile_get_config_from_args(
        self,
        args
    ) -> ToolMobileGetConfigResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetConfigResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_mobile_get_config_with_http_info(
        self,
        section: Annotated[Optional[StrictStr], Field(description="Settings section name.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolMobileGetConfigResponse]:
        """Returns a list of the site configurations, filtering by section.

        Returns a list of the site configurations, filtering by section.

        :param section: Settings section name.
        :type section: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_config_serialize(
            section=section,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetConfigResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_mobile_get_config_without_preload_content(
        self,
        section: Annotated[Optional[StrictStr], Field(description="Settings section name.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of the site configurations, filtering by section.

        Returns a list of the site configurations, filtering by section.

        :param section: Settings section name.
        :type section: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_config_serialize(
            section=section,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetConfigResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_mobile_get_config_serialize(
        self,
        section,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_mobile_get_config'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_mobile_get_config'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_mobile_get_config',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if section is not None:
            _form_params += parse_form({'section': section})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_mobile_get_content_args(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component where the class is e.g. mod_assign.")],
        method: Annotated[Optional[StrictStr], Field(description="Method to execute in class \\\\$component\\\\output\\\\mobile.")],
        args: Annotated[Optional[List[ToolMobileGetContentParametersArgsInner]], Field(description="Args for the method are optional.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a piece of content to be displayed in the Mobile app.

        Returns a piece of content to be displayed in the Mobile app.

        :param component: Component where the class is e.g. mod_assign. (required)
        :type component: str
        :param method: Method to execute in class \\\\$component\\\\output\\\\mobile. (required)
        :type method: str
        :param args: Args for the method are optional.
        :type args: List[ToolMobileGetContentParametersArgsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_content_serialize(
            component=component,
            method=method,
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetContentResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_mobile_get_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component where the class is e.g. mod_assign.")],
        method: Annotated[Optional[StrictStr], Field(description="Method to execute in class \\\\$component\\\\output\\\\mobile.")],
        args: Annotated[Optional[List[ToolMobileGetContentParametersArgsInner]], Field(description="Args for the method are optional.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolMobileGetContentResponse:
        """Returns a piece of content to be displayed in the Mobile app.

        Returns a piece of content to be displayed in the Mobile app.

        :param component: Component where the class is e.g. mod_assign. (required)
        :type component: str
        :param method: Method to execute in class \\\\$component\\\\output\\\\mobile. (required)
        :type method: str
        :param args: Args for the method are optional.
        :type args: List[ToolMobileGetContentParametersArgsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_content_serialize(
            component=component,
            method=method,
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_mobile_get_content_from_args(
        self,
        args
    ) -> ToolMobileGetContentResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetContentResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_mobile_get_content_with_http_info(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component where the class is e.g. mod_assign.")],
        method: Annotated[Optional[StrictStr], Field(description="Method to execute in class \\\\$component\\\\output\\\\mobile.")],
        args: Annotated[Optional[List[ToolMobileGetContentParametersArgsInner]], Field(description="Args for the method are optional.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolMobileGetContentResponse]:
        """Returns a piece of content to be displayed in the Mobile app.

        Returns a piece of content to be displayed in the Mobile app.

        :param component: Component where the class is e.g. mod_assign. (required)
        :type component: str
        :param method: Method to execute in class \\\\$component\\\\output\\\\mobile. (required)
        :type method: str
        :param args: Args for the method are optional.
        :type args: List[ToolMobileGetContentParametersArgsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_content_serialize(
            component=component,
            method=method,
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_mobile_get_content_without_preload_content(
        self,
        component: Annotated[Optional[StrictStr], Field(description="Component where the class is e.g. mod_assign.")],
        method: Annotated[Optional[StrictStr], Field(description="Method to execute in class \\\\$component\\\\output\\\\mobile.")],
        args: Annotated[Optional[List[ToolMobileGetContentParametersArgsInner]], Field(description="Args for the method are optional.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a piece of content to be displayed in the Mobile app.

        Returns a piece of content to be displayed in the Mobile app.

        :param component: Component where the class is e.g. mod_assign. (required)
        :type component: str
        :param method: Method to execute in class \\\\$component\\\\output\\\\mobile. (required)
        :type method: str
        :param args: Args for the method are optional.
        :type args: List[ToolMobileGetContentParametersArgsInner]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_content_serialize(
            component=component,
            method=method,
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetContentResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_mobile_get_content_serialize(
        self,
        component,
        method,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'args': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#tool_mobile_get_content'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_mobile_get_content'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_mobile_get_content',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if args is not None:
            _form_params += parse_form({'args': args})
        if component is not None:
            _form_params += parse_form({'component': component})
        if method is not None:
            _form_params += parse_form({'method': method})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_mobile_get_plugins_supporting_mobile_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of Moodle plugins supporting the mobile app.

        Returns a list of Moodle plugins supporting the mobile app.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_plugins_supporting_mobile_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetPluginsSupportingMobileResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_mobile_get_plugins_supporting_mobile(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolMobileGetPluginsSupportingMobileResponse:
        """Returns a list of Moodle plugins supporting the mobile app.

        Returns a list of Moodle plugins supporting the mobile app.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_plugins_supporting_mobile_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetPluginsSupportingMobileResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_mobile_get_plugins_supporting_mobile_from_args(
        self,
        args
    ) -> ToolMobileGetPluginsSupportingMobileResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetPluginsSupportingMobileResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_mobile_get_plugins_supporting_mobile_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolMobileGetPluginsSupportingMobileResponse]:
        """Returns a list of Moodle plugins supporting the mobile app.

        Returns a list of Moodle plugins supporting the mobile app.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_plugins_supporting_mobile_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetPluginsSupportingMobileResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_mobile_get_plugins_supporting_mobile_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of Moodle plugins supporting the mobile app.

        Returns a list of Moodle plugins supporting the mobile app.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_plugins_supporting_mobile_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetPluginsSupportingMobileResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_mobile_get_plugins_supporting_mobile_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#tool_mobile_get_plugins_supporting_mobile'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_mobile_get_plugins_supporting_mobile'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_mobile_get_plugins_supporting_mobile',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_mobile_get_public_config_args(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a list of the site public settings, those not requiring authentication.

        Returns a list of the site public settings, those not requiring authentication.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_public_config_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetPublicConfigResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_mobile_get_public_config(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolMobileGetPublicConfigResponse:
        """Returns a list of the site public settings, those not requiring authentication.

        Returns a list of the site public settings, those not requiring authentication.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_public_config_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetPublicConfigResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_mobile_get_public_config_from_args(
        self,
        args
    ) -> ToolMobileGetPublicConfigResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetPublicConfigResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_mobile_get_public_config_with_http_info(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolMobileGetPublicConfigResponse]:
        """Returns a list of the site public settings, those not requiring authentication.

        Returns a list of the site public settings, those not requiring authentication.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_public_config_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetPublicConfigResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_mobile_get_public_config_without_preload_content(
        self,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a list of the site public settings, those not requiring authentication.

        Returns a list of the site public settings, those not requiring authentication.

        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_public_config_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetPublicConfigResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_mobile_get_public_config_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#tool_mobile_get_public_config'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_mobile_get_public_config'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_mobile_get_public_config',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_mobile_get_tokens_for_qr_login_args(
        self,
        args: ToolMobileGetTokensForQrLoginParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Returns a WebService token (and private token) for QR login.

        Returns a WebService token (and private token) for QR login.

        :param args: (required)
        :type args: ToolMobileGetTokensForQrLoginParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_tokens_for_qr_login_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetTokensForQrLoginResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_mobile_get_tokens_for_qr_login(
        self,
        args: ToolMobileGetTokensForQrLoginParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolMobileGetTokensForQrLoginResponse:
        """Returns a WebService token (and private token) for QR login.

        Returns a WebService token (and private token) for QR login.

        :param args: (required)
        :type args: ToolMobileGetTokensForQrLoginParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_tokens_for_qr_login_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetTokensForQrLoginResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_mobile_get_tokens_for_qr_login_from_args(
        self,
        args
    ) -> ToolMobileGetTokensForQrLoginResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetTokensForQrLoginResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_mobile_get_tokens_for_qr_login_with_http_info(
        self,
        args: ToolMobileGetTokensForQrLoginParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolMobileGetTokensForQrLoginResponse]:
        """Returns a WebService token (and private token) for QR login.

        Returns a WebService token (and private token) for QR login.

        :param args: (required)
        :type args: ToolMobileGetTokensForQrLoginParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_tokens_for_qr_login_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetTokensForQrLoginResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_mobile_get_tokens_for_qr_login_without_preload_content(
        self,
        args: ToolMobileGetTokensForQrLoginParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Returns a WebService token (and private token) for QR login.

        Returns a WebService token (and private token) for QR login.

        :param args: (required)
        :type args: ToolMobileGetTokensForQrLoginParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_get_tokens_for_qr_login_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileGetTokensForQrLoginResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_mobile_get_tokens_for_qr_login_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#tool_mobile_get_tokens_for_qr_login'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_mobile_get_tokens_for_qr_login'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_mobile_get_tokens_for_qr_login',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_mobile_validate_subscription_key_args(
        self,
        args: ToolMobileValidateSubscriptionKeyParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Check if the given site subscription key is valid.

        Check if the given site subscription key is valid.

        :param args: (required)
        :type args: ToolMobileValidateSubscriptionKeyParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_validate_subscription_key_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileValidateSubscriptionKeyResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_mobile_validate_subscription_key(
        self,
        args: ToolMobileValidateSubscriptionKeyParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolMobileValidateSubscriptionKeyResponse:
        """Check if the given site subscription key is valid.

        Check if the given site subscription key is valid.

        :param args: (required)
        :type args: ToolMobileValidateSubscriptionKeyParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_validate_subscription_key_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileValidateSubscriptionKeyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_mobile_validate_subscription_key_from_args(
        self,
        args
    ) -> ToolMobileValidateSubscriptionKeyResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileValidateSubscriptionKeyResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_mobile_validate_subscription_key_with_http_info(
        self,
        args: ToolMobileValidateSubscriptionKeyParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolMobileValidateSubscriptionKeyResponse]:
        """Check if the given site subscription key is valid.

        Check if the given site subscription key is valid.

        :param args: (required)
        :type args: ToolMobileValidateSubscriptionKeyParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_validate_subscription_key_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileValidateSubscriptionKeyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_mobile_validate_subscription_key_without_preload_content(
        self,
        args: ToolMobileValidateSubscriptionKeyParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Check if the given site subscription key is valid.

        Check if the given site subscription key is valid.

        :param args: (required)
        :type args: ToolMobileValidateSubscriptionKeyParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_mobile_validate_subscription_key_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMobileValidateSubscriptionKeyResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_mobile_validate_subscription_key_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#tool_mobile_validate_subscription_key'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_mobile_validate_subscription_key'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_mobile_validate_subscription_key',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_moodlenet_search_courses_args(
        self,
        searchvalue: Annotated[Optional[StrictStr], Field(description="search value")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """For some given input search for a course that matches

        For some given input search for a course that matches

        :param searchvalue: search value (required)
        :type searchvalue: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_moodlenet_search_courses_serialize(
            searchvalue=searchvalue,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMoodlenetSearchCoursesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_moodlenet_search_courses(
        self,
        searchvalue: Annotated[Optional[StrictStr], Field(description="search value")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolMoodlenetSearchCoursesResponse:
        """For some given input search for a course that matches

        For some given input search for a course that matches

        :param searchvalue: search value (required)
        :type searchvalue: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_moodlenet_search_courses_serialize(
            searchvalue=searchvalue,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMoodlenetSearchCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_moodlenet_search_courses_from_args(
        self,
        args
    ) -> ToolMoodlenetSearchCoursesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMoodlenetSearchCoursesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_moodlenet_search_courses_with_http_info(
        self,
        searchvalue: Annotated[Optional[StrictStr], Field(description="search value")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolMoodlenetSearchCoursesResponse]:
        """For some given input search for a course that matches

        For some given input search for a course that matches

        :param searchvalue: search value (required)
        :type searchvalue: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_moodlenet_search_courses_serialize(
            searchvalue=searchvalue,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMoodlenetSearchCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_moodlenet_search_courses_without_preload_content(
        self,
        searchvalue: Annotated[Optional[StrictStr], Field(description="search value")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """For some given input search for a course that matches

        For some given input search for a course that matches

        :param searchvalue: search value (required)
        :type searchvalue: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_moodlenet_search_courses_serialize(
            searchvalue=searchvalue,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMoodlenetSearchCoursesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_moodlenet_search_courses_serialize(
        self,
        searchvalue,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_moodlenet_search_courses'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_moodlenet_search_courses'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_moodlenet_search_courses',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if searchvalue is not None:
            _form_params += parse_form({'searchvalue': searchvalue})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_moodlenet_verify_webfinger_args(
        self,
        course: Annotated[Optional[StrictInt], Field(description="The course we are adding to")],
        profileurl: Annotated[Optional[StrictStr], Field(description="The profile url that the user has given us")],
        section: Annotated[Optional[StrictInt], Field(description="The section within the course we are adding to")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Verify if the passed information resolves into a WebFinger profile URL

        Verify if the passed information resolves into a WebFinger profile URL

        :param course: The course we are adding to (required)
        :type course: int
        :param profileurl: The profile url that the user has given us (required)
        :type profileurl: str
        :param section: The section within the course we are adding to (required)
        :type section: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_moodlenet_verify_webfinger_serialize(
            course=course,
            profileurl=profileurl,
            section=section,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMoodlenetVerifyWebfingerResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_moodlenet_verify_webfinger(
        self,
        course: Annotated[Optional[StrictInt], Field(description="The course we are adding to")],
        profileurl: Annotated[Optional[StrictStr], Field(description="The profile url that the user has given us")],
        section: Annotated[Optional[StrictInt], Field(description="The section within the course we are adding to")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolMoodlenetVerifyWebfingerResponse:
        """Verify if the passed information resolves into a WebFinger profile URL

        Verify if the passed information resolves into a WebFinger profile URL

        :param course: The course we are adding to (required)
        :type course: int
        :param profileurl: The profile url that the user has given us (required)
        :type profileurl: str
        :param section: The section within the course we are adding to (required)
        :type section: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_moodlenet_verify_webfinger_serialize(
            course=course,
            profileurl=profileurl,
            section=section,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMoodlenetVerifyWebfingerResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_moodlenet_verify_webfinger_from_args(
        self,
        args
    ) -> ToolMoodlenetVerifyWebfingerResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMoodlenetVerifyWebfingerResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_moodlenet_verify_webfinger_with_http_info(
        self,
        course: Annotated[Optional[StrictInt], Field(description="The course we are adding to")],
        profileurl: Annotated[Optional[StrictStr], Field(description="The profile url that the user has given us")],
        section: Annotated[Optional[StrictInt], Field(description="The section within the course we are adding to")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolMoodlenetVerifyWebfingerResponse]:
        """Verify if the passed information resolves into a WebFinger profile URL

        Verify if the passed information resolves into a WebFinger profile URL

        :param course: The course we are adding to (required)
        :type course: int
        :param profileurl: The profile url that the user has given us (required)
        :type profileurl: str
        :param section: The section within the course we are adding to (required)
        :type section: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_moodlenet_verify_webfinger_serialize(
            course=course,
            profileurl=profileurl,
            section=section,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMoodlenetVerifyWebfingerResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_moodlenet_verify_webfinger_without_preload_content(
        self,
        course: Annotated[Optional[StrictInt], Field(description="The course we are adding to")],
        profileurl: Annotated[Optional[StrictStr], Field(description="The profile url that the user has given us")],
        section: Annotated[Optional[StrictInt], Field(description="The section within the course we are adding to")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Verify if the passed information resolves into a WebFinger profile URL

        Verify if the passed information resolves into a WebFinger profile URL

        :param course: The course we are adding to (required)
        :type course: int
        :param profileurl: The profile url that the user has given us (required)
        :type profileurl: str
        :param section: The section within the course we are adding to (required)
        :type section: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_moodlenet_verify_webfinger_serialize(
            course=course,
            profileurl=profileurl,
            section=section,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolMoodlenetVerifyWebfingerResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_moodlenet_verify_webfinger_serialize(
        self,
        course,
        profileurl,
        section,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_moodlenet_verify_webfinger'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_moodlenet_verify_webfinger'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_moodlenet_verify_webfinger',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if course is not None:
            _form_params += parse_form({'course': course})
        if profileurl is not None:
            _form_params += parse_form({'profileurl': profileurl})
        if section is not None:
            _form_params += parse_form({'section': section})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_policy_get_policy_version_args(
        self,
        args: ToolPolicyGetPolicyVersionParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetch the details of a policy version

        Fetch the details of a policy version

        :param args: (required)
        :type args: ToolPolicyGetPolicyVersionParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_policy_get_policy_version_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolPolicyGetPolicyVersionResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_policy_get_policy_version(
        self,
        args: ToolPolicyGetPolicyVersionParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolPolicyGetPolicyVersionResponse:
        """Fetch the details of a policy version

        Fetch the details of a policy version

        :param args: (required)
        :type args: ToolPolicyGetPolicyVersionParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_policy_get_policy_version_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolPolicyGetPolicyVersionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_policy_get_policy_version_from_args(
        self,
        args
    ) -> ToolPolicyGetPolicyVersionResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolPolicyGetPolicyVersionResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_policy_get_policy_version_with_http_info(
        self,
        args: ToolPolicyGetPolicyVersionParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolPolicyGetPolicyVersionResponse]:
        """Fetch the details of a policy version

        Fetch the details of a policy version

        :param args: (required)
        :type args: ToolPolicyGetPolicyVersionParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_policy_get_policy_version_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolPolicyGetPolicyVersionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_policy_get_policy_version_without_preload_content(
        self,
        args: ToolPolicyGetPolicyVersionParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetch the details of a policy version

        Fetch the details of a policy version

        :param args: (required)
        :type args: ToolPolicyGetPolicyVersionParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_policy_get_policy_version_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolPolicyGetPolicyVersionResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_policy_get_policy_version_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#tool_policy_get_policy_version'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_policy_get_policy_version'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_policy_get_policy_version',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_policy_get_user_acceptances_args(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user id we want to retrieve the acceptances.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Get user policies acceptances.

        Get user policies acceptances.

        :param userid: The user id we want to retrieve the acceptances.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_policy_get_user_acceptances_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolPolicyGetUserAcceptancesResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_policy_get_user_acceptances(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user id we want to retrieve the acceptances.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolPolicyGetUserAcceptancesResponse:
        """Get user policies acceptances.

        Get user policies acceptances.

        :param userid: The user id we want to retrieve the acceptances.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_policy_get_user_acceptances_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolPolicyGetUserAcceptancesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_policy_get_user_acceptances_from_args(
        self,
        args
    ) -> ToolPolicyGetUserAcceptancesResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolPolicyGetUserAcceptancesResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_policy_get_user_acceptances_with_http_info(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user id we want to retrieve the acceptances.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolPolicyGetUserAcceptancesResponse]:
        """Get user policies acceptances.

        Get user policies acceptances.

        :param userid: The user id we want to retrieve the acceptances.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_policy_get_user_acceptances_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolPolicyGetUserAcceptancesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_policy_get_user_acceptances_without_preload_content(
        self,
        userid: Annotated[Optional[StrictInt], Field(description="The user id we want to retrieve the acceptances.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get user policies acceptances.

        Get user policies acceptances.

        :param userid: The user id we want to retrieve the acceptances.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_policy_get_user_acceptances_serialize(
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolPolicyGetUserAcceptancesResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_policy_get_user_acceptances_serialize(
        self,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_policy_get_user_acceptances'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_policy_get_user_acceptances'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_policy_get_user_acceptances',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_policy_set_acceptances_status_args(
        self,
        policies: Annotated[List[ToolPolicySetAcceptancesStatusParametersPoliciesInner], Field(description="Policies acceptances for the given user.")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id we want to set the acceptances. Default is the current user.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Set the acceptance status (accept or decline only) for the indicated policies for the given user.

        Set the acceptance status (accept or decline only) for the indicated policies for the given user.

        :param policies: Policies acceptances for the given user. (required)
        :type policies: List[ToolPolicySetAcceptancesStatusParametersPoliciesInner]
        :param userid: The user id we want to set the acceptances. Default is the current user.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_policy_set_acceptances_status_serialize(
            policies=policies,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolPolicySetAcceptancesStatusResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_policy_set_acceptances_status(
        self,
        policies: Annotated[List[ToolPolicySetAcceptancesStatusParametersPoliciesInner], Field(description="Policies acceptances for the given user.")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id we want to set the acceptances. Default is the current user.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolPolicySetAcceptancesStatusResponse:
        """Set the acceptance status (accept or decline only) for the indicated policies for the given user.

        Set the acceptance status (accept or decline only) for the indicated policies for the given user.

        :param policies: Policies acceptances for the given user. (required)
        :type policies: List[ToolPolicySetAcceptancesStatusParametersPoliciesInner]
        :param userid: The user id we want to set the acceptances. Default is the current user.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_policy_set_acceptances_status_serialize(
            policies=policies,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolPolicySetAcceptancesStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_policy_set_acceptances_status_from_args(
        self,
        args
    ) -> ToolPolicySetAcceptancesStatusResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolPolicySetAcceptancesStatusResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_policy_set_acceptances_status_with_http_info(
        self,
        policies: Annotated[List[ToolPolicySetAcceptancesStatusParametersPoliciesInner], Field(description="Policies acceptances for the given user.")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id we want to set the acceptances. Default is the current user.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolPolicySetAcceptancesStatusResponse]:
        """Set the acceptance status (accept or decline only) for the indicated policies for the given user.

        Set the acceptance status (accept or decline only) for the indicated policies for the given user.

        :param policies: Policies acceptances for the given user. (required)
        :type policies: List[ToolPolicySetAcceptancesStatusParametersPoliciesInner]
        :param userid: The user id we want to set the acceptances. Default is the current user.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_policy_set_acceptances_status_serialize(
            policies=policies,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolPolicySetAcceptancesStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_policy_set_acceptances_status_without_preload_content(
        self,
        policies: Annotated[List[ToolPolicySetAcceptancesStatusParametersPoliciesInner], Field(description="Policies acceptances for the given user.")],
        userid: Annotated[Optional[StrictInt], Field(description="The user id we want to set the acceptances. Default is the current user.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Set the acceptance status (accept or decline only) for the indicated policies for the given user.

        Set the acceptance status (accept or decline only) for the indicated policies for the given user.

        :param policies: Policies acceptances for the given user. (required)
        :type policies: List[ToolPolicySetAcceptancesStatusParametersPoliciesInner]
        :param userid: The user id we want to set the acceptances. Default is the current user.
        :type userid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_policy_set_acceptances_status_serialize(
            policies=policies,
            userid=userid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolPolicySetAcceptancesStatusResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_policy_set_acceptances_status_serialize(
        self,
        policies,
        userid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'policies': 'csv',
        }

        _resource_path = '/webservice/rest/server.php#tool_policy_set_acceptances_status'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_policy_set_acceptances_status'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_policy_set_acceptances_status',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if policies is not None:
            _form_params += parse_form({'policies': policies})
        if userid is not None:
            _form_params += parse_form({'userid': userid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_policy_submit_accept_on_behalf_args(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data from the create group form, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Accept policies on behalf of other users

        Accept policies on behalf of other users

        :param jsonformdata: The data from the create group form, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_policy_submit_accept_on_behalf_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_policy_submit_accept_on_behalf(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data from the create group form, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bool:
        """Accept policies on behalf of other users

        Accept policies on behalf of other users

        :param jsonformdata: The data from the create group form, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_policy_submit_accept_on_behalf_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_policy_submit_accept_on_behalf_from_args(
        self,
        args
    ) -> bool:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_policy_submit_accept_on_behalf_with_http_info(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data from the create group form, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bool]:
        """Accept policies on behalf of other users

        Accept policies on behalf of other users

        :param jsonformdata: The data from the create group form, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_policy_submit_accept_on_behalf_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_policy_submit_accept_on_behalf_without_preload_content(
        self,
        jsonformdata: Annotated[Optional[StrictStr], Field(description="The data from the create group form, encoded as a json array")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Accept policies on behalf of other users

        Accept policies on behalf of other users

        :param jsonformdata: The data from the create group form, encoded as a json array (required)
        :type jsonformdata: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_policy_submit_accept_on_behalf_serialize(
            jsonformdata=jsonformdata,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "bool",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_policy_submit_accept_on_behalf_serialize(
        self,
        jsonformdata,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_policy_submit_accept_on_behalf'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_policy_submit_accept_on_behalf'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_policy_submit_accept_on_behalf',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if jsonformdata is not None:
            _form_params += parse_form({'jsonformdata': jsonformdata})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_templatelibrary_list_templates_args(
        self,
        args: ToolTemplatelibraryListTemplatesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """List/search templates by component.

        List/search templates by component.

        :param args: (required)
        :type args: ToolTemplatelibraryListTemplatesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_templatelibrary_list_templates_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[Optional[str]]",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_templatelibrary_list_templates(
        self,
        args: ToolTemplatelibraryListTemplatesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[Optional[str]]:
        """List/search templates by component.

        List/search templates by component.

        :param args: (required)
        :type args: ToolTemplatelibraryListTemplatesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_templatelibrary_list_templates_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[Optional[str]]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_templatelibrary_list_templates_from_args(
        self,
        args
    ) -> List[Optional[str]]:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[Optional[str]]",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_templatelibrary_list_templates_with_http_info(
        self,
        args: ToolTemplatelibraryListTemplatesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[Optional[str]]]:
        """List/search templates by component.

        List/search templates by component.

        :param args: (required)
        :type args: ToolTemplatelibraryListTemplatesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_templatelibrary_list_templates_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[Optional[str]]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_templatelibrary_list_templates_without_preload_content(
        self,
        args: ToolTemplatelibraryListTemplatesParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List/search templates by component.

        List/search templates by component.

        :param args: (required)
        :type args: ToolTemplatelibraryListTemplatesParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_templatelibrary_list_templates_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[Optional[str]]",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_templatelibrary_list_templates_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#tool_templatelibrary_list_templates'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_templatelibrary_list_templates'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_templatelibrary_list_templates',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_templatelibrary_load_canonical_template_args(
        self,
        args: ToolTemplatelibraryLoadCanonicalTemplateParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Load a canonical template by name (not the theme overidden one).

        Load a canonical template by name (not the theme overidden one).

        :param args: (required)
        :type args: ToolTemplatelibraryLoadCanonicalTemplateParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_templatelibrary_load_canonical_template_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_templatelibrary_load_canonical_template(
        self,
        args: ToolTemplatelibraryLoadCanonicalTemplateParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> str:
        """Load a canonical template by name (not the theme overidden one).

        Load a canonical template by name (not the theme overidden one).

        :param args: (required)
        :type args: ToolTemplatelibraryLoadCanonicalTemplateParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_templatelibrary_load_canonical_template_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_templatelibrary_load_canonical_template_from_args(
        self,
        args
    ) -> str:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_templatelibrary_load_canonical_template_with_http_info(
        self,
        args: ToolTemplatelibraryLoadCanonicalTemplateParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[str]:
        """Load a canonical template by name (not the theme overidden one).

        Load a canonical template by name (not the theme overidden one).

        :param args: (required)
        :type args: ToolTemplatelibraryLoadCanonicalTemplateParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_templatelibrary_load_canonical_template_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_templatelibrary_load_canonical_template_without_preload_content(
        self,
        args: ToolTemplatelibraryLoadCanonicalTemplateParameters,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Load a canonical template by name (not the theme overidden one).

        Load a canonical template by name (not the theme overidden one).

        :param args: (required)
        :type args: ToolTemplatelibraryLoadCanonicalTemplateParameters
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_templatelibrary_load_canonical_template_serialize(
            args=args,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "str",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_templatelibrary_load_canonical_template_serialize(
        self,
        args,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/lib/ajax/service-nologin.php#tool_templatelibrary_load_canonical_template'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_templatelibrary_load_canonical_template'))
        if args is not None:
            
            _query_params.append(('args', args))
            
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_templatelibrary_load_canonical_template',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_usertours_complete_tour_args(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Context ID")],
        pageurl: Annotated[Optional[StrictStr], Field(description="Page URL")],
        stepid: Annotated[Optional[StrictInt], Field(description="Step ID")],
        stepindex: Annotated[Optional[StrictInt], Field(description="Step Number")],
        tourid: Annotated[Optional[StrictInt], Field(description="Tour ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Mark the specified tour as completed for the current user

        Mark the specified tour as completed for the current user

        :param context: Context ID (required)
        :type context: int
        :param pageurl: Page URL (required)
        :type pageurl: str
        :param stepid: Step ID (required)
        :type stepid: int
        :param stepindex: Step Number (required)
        :type stepindex: int
        :param tourid: Tour ID (required)
        :type tourid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_usertours_complete_tour_serialize(
            context=context,
            pageurl=pageurl,
            stepid=stepid,
            stepindex=stepindex,
            tourid=tourid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_usertours_complete_tour(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Context ID")],
        pageurl: Annotated[Optional[StrictStr], Field(description="Page URL")],
        stepid: Annotated[Optional[StrictInt], Field(description="Step ID")],
        stepindex: Annotated[Optional[StrictInt], Field(description="Step Number")],
        tourid: Annotated[Optional[StrictInt], Field(description="Tour ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Mark the specified tour as completed for the current user

        Mark the specified tour as completed for the current user

        :param context: Context ID (required)
        :type context: int
        :param pageurl: Page URL (required)
        :type pageurl: str
        :param stepid: Step ID (required)
        :type stepid: int
        :param stepindex: Step Number (required)
        :type stepindex: int
        :param tourid: Tour ID (required)
        :type tourid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_usertours_complete_tour_serialize(
            context=context,
            pageurl=pageurl,
            stepid=stepid,
            stepindex=stepindex,
            tourid=tourid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_usertours_complete_tour_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_usertours_complete_tour_with_http_info(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Context ID")],
        pageurl: Annotated[Optional[StrictStr], Field(description="Page URL")],
        stepid: Annotated[Optional[StrictInt], Field(description="Step ID")],
        stepindex: Annotated[Optional[StrictInt], Field(description="Step Number")],
        tourid: Annotated[Optional[StrictInt], Field(description="Tour ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Mark the specified tour as completed for the current user

        Mark the specified tour as completed for the current user

        :param context: Context ID (required)
        :type context: int
        :param pageurl: Page URL (required)
        :type pageurl: str
        :param stepid: Step ID (required)
        :type stepid: int
        :param stepindex: Step Number (required)
        :type stepindex: int
        :param tourid: Tour ID (required)
        :type tourid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_usertours_complete_tour_serialize(
            context=context,
            pageurl=pageurl,
            stepid=stepid,
            stepindex=stepindex,
            tourid=tourid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_usertours_complete_tour_without_preload_content(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Context ID")],
        pageurl: Annotated[Optional[StrictStr], Field(description="Page URL")],
        stepid: Annotated[Optional[StrictInt], Field(description="Step ID")],
        stepindex: Annotated[Optional[StrictInt], Field(description="Step Number")],
        tourid: Annotated[Optional[StrictInt], Field(description="Tour ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Mark the specified tour as completed for the current user

        Mark the specified tour as completed for the current user

        :param context: Context ID (required)
        :type context: int
        :param pageurl: Page URL (required)
        :type pageurl: str
        :param stepid: Step ID (required)
        :type stepid: int
        :param stepindex: Step Number (required)
        :type stepindex: int
        :param tourid: Tour ID (required)
        :type tourid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_usertours_complete_tour_serialize(
            context=context,
            pageurl=pageurl,
            stepid=stepid,
            stepindex=stepindex,
            tourid=tourid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_usertours_complete_tour_serialize(
        self,
        context,
        pageurl,
        stepid,
        stepindex,
        tourid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_usertours_complete_tour'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_usertours_complete_tour'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_usertours_complete_tour',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if context is not None:
            _form_params += parse_form({'context': context})
        if pageurl is not None:
            _form_params += parse_form({'pageurl': pageurl})
        if stepid is not None:
            _form_params += parse_form({'stepid': stepid})
        if stepindex is not None:
            _form_params += parse_form({'stepindex': stepindex})
        if tourid is not None:
            _form_params += parse_form({'tourid': tourid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_usertours_fetch_and_start_tour_args(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Context ID")],
        pageurl: Annotated[Optional[StrictStr], Field(description="Page URL")],
        tourid: Annotated[Optional[StrictInt], Field(description="Tour ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Fetch the specified tour

        Fetch the specified tour

        :param context: Context ID (required)
        :type context: int
        :param pageurl: Page URL (required)
        :type pageurl: str
        :param tourid: Tour ID (required)
        :type tourid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_usertours_fetch_and_start_tour_serialize(
            context=context,
            pageurl=pageurl,
            tourid=tourid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolUsertoursFetchAndStartTourResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_usertours_fetch_and_start_tour(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Context ID")],
        pageurl: Annotated[Optional[StrictStr], Field(description="Page URL")],
        tourid: Annotated[Optional[StrictInt], Field(description="Tour ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolUsertoursFetchAndStartTourResponse:
        """Fetch the specified tour

        Fetch the specified tour

        :param context: Context ID (required)
        :type context: int
        :param pageurl: Page URL (required)
        :type pageurl: str
        :param tourid: Tour ID (required)
        :type tourid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_usertours_fetch_and_start_tour_serialize(
            context=context,
            pageurl=pageurl,
            tourid=tourid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolUsertoursFetchAndStartTourResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_usertours_fetch_and_start_tour_from_args(
        self,
        args
    ) -> ToolUsertoursFetchAndStartTourResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolUsertoursFetchAndStartTourResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_usertours_fetch_and_start_tour_with_http_info(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Context ID")],
        pageurl: Annotated[Optional[StrictStr], Field(description="Page URL")],
        tourid: Annotated[Optional[StrictInt], Field(description="Tour ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolUsertoursFetchAndStartTourResponse]:
        """Fetch the specified tour

        Fetch the specified tour

        :param context: Context ID (required)
        :type context: int
        :param pageurl: Page URL (required)
        :type pageurl: str
        :param tourid: Tour ID (required)
        :type tourid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_usertours_fetch_and_start_tour_serialize(
            context=context,
            pageurl=pageurl,
            tourid=tourid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolUsertoursFetchAndStartTourResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_usertours_fetch_and_start_tour_without_preload_content(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Context ID")],
        pageurl: Annotated[Optional[StrictStr], Field(description="Page URL")],
        tourid: Annotated[Optional[StrictInt], Field(description="Tour ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Fetch the specified tour

        Fetch the specified tour

        :param context: Context ID (required)
        :type context: int
        :param pageurl: Page URL (required)
        :type pageurl: str
        :param tourid: Tour ID (required)
        :type tourid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_usertours_fetch_and_start_tour_serialize(
            context=context,
            pageurl=pageurl,
            tourid=tourid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolUsertoursFetchAndStartTourResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_usertours_fetch_and_start_tour_serialize(
        self,
        context,
        pageurl,
        tourid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_usertours_fetch_and_start_tour'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_usertours_fetch_and_start_tour'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_usertours_fetch_and_start_tour',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if context is not None:
            _form_params += parse_form({'context': context})
        if pageurl is not None:
            _form_params += parse_form({'pageurl': pageurl})
        if tourid is not None:
            _form_params += parse_form({'tourid': tourid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_usertours_reset_tour_args(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Context ID")],
        pageurl: Annotated[Optional[StrictStr], Field(description="Current page location")],
        tourid: Annotated[Optional[StrictInt], Field(description="Tour ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Remove the specified tour

        Remove the specified tour

        :param context: Context ID (required)
        :type context: int
        :param pageurl: Current page location (required)
        :type pageurl: str
        :param tourid: Tour ID (required)
        :type tourid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_usertours_reset_tour_serialize(
            context=context,
            pageurl=pageurl,
            tourid=tourid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolUsertoursResetTourResponse",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_usertours_reset_tour(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Context ID")],
        pageurl: Annotated[Optional[StrictStr], Field(description="Current page location")],
        tourid: Annotated[Optional[StrictInt], Field(description="Tour ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ToolUsertoursResetTourResponse:
        """Remove the specified tour

        Remove the specified tour

        :param context: Context ID (required)
        :type context: int
        :param pageurl: Current page location (required)
        :type pageurl: str
        :param tourid: Tour ID (required)
        :type tourid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_usertours_reset_tour_serialize(
            context=context,
            pageurl=pageurl,
            tourid=tourid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolUsertoursResetTourResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_usertours_reset_tour_from_args(
        self,
        args
    ) -> ToolUsertoursResetTourResponse:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolUsertoursResetTourResponse",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_usertours_reset_tour_with_http_info(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Context ID")],
        pageurl: Annotated[Optional[StrictStr], Field(description="Current page location")],
        tourid: Annotated[Optional[StrictInt], Field(description="Tour ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ToolUsertoursResetTourResponse]:
        """Remove the specified tour

        Remove the specified tour

        :param context: Context ID (required)
        :type context: int
        :param pageurl: Current page location (required)
        :type pageurl: str
        :param tourid: Tour ID (required)
        :type tourid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_usertours_reset_tour_serialize(
            context=context,
            pageurl=pageurl,
            tourid=tourid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolUsertoursResetTourResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_usertours_reset_tour_without_preload_content(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Context ID")],
        pageurl: Annotated[Optional[StrictStr], Field(description="Current page location")],
        tourid: Annotated[Optional[StrictInt], Field(description="Tour ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Remove the specified tour

        Remove the specified tour

        :param context: Context ID (required)
        :type context: int
        :param pageurl: Current page location (required)
        :type pageurl: str
        :param tourid: Tour ID (required)
        :type tourid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_usertours_reset_tour_serialize(
            context=context,
            pageurl=pageurl,
            tourid=tourid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ToolUsertoursResetTourResponse",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_usertours_reset_tour_serialize(
        self,
        context,
        pageurl,
        tourid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_usertours_reset_tour'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_usertours_reset_tour'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_usertours_reset_tour',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if context is not None:
            _form_params += parse_form({'context': context})
        if pageurl is not None:
            _form_params += parse_form({'pageurl': pageurl})
        if tourid is not None:
            _form_params += parse_form({'tourid': tourid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_usertours_step_shown_args(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Context ID")],
        pageurl: Annotated[Optional[StrictStr], Field(description="Page URL")],
        stepid: Annotated[Optional[StrictInt], Field(description="Step ID")],
        stepindex: Annotated[Optional[StrictInt], Field(description="Step Number")],
        tourid: Annotated[Optional[StrictInt], Field(description="Tour ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """Mark the specified step as completed for the current user

        Mark the specified step as completed for the current user

        :param context: Context ID (required)
        :type context: int
        :param pageurl: Page URL (required)
        :type pageurl: str
        :param stepid: Step ID (required)
        :type stepid: int
        :param stepindex: Step Number (required)
        :type stepindex: int
        :param tourid: Tour ID (required)
        :type tourid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_usertours_step_shown_serialize(
            context=context,
            pageurl=pageurl,
            stepid=stepid,
            stepindex=stepindex,
            tourid=tourid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_usertours_step_shown(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Context ID")],
        pageurl: Annotated[Optional[StrictStr], Field(description="Page URL")],
        stepid: Annotated[Optional[StrictInt], Field(description="Step ID")],
        stepindex: Annotated[Optional[StrictInt], Field(description="Step Number")],
        tourid: Annotated[Optional[StrictInt], Field(description="Tour ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Mark the specified step as completed for the current user

        Mark the specified step as completed for the current user

        :param context: Context ID (required)
        :type context: int
        :param pageurl: Page URL (required)
        :type pageurl: str
        :param stepid: Step ID (required)
        :type stepid: int
        :param stepindex: Step Number (required)
        :type stepindex: int
        :param tourid: Tour ID (required)
        :type tourid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_usertours_step_shown_serialize(
            context=context,
            pageurl=pageurl,
            stepid=stepid,
            stepindex=stepindex,
            tourid=tourid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_usertours_step_shown_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_usertours_step_shown_with_http_info(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Context ID")],
        pageurl: Annotated[Optional[StrictStr], Field(description="Page URL")],
        stepid: Annotated[Optional[StrictInt], Field(description="Step ID")],
        stepindex: Annotated[Optional[StrictInt], Field(description="Step Number")],
        tourid: Annotated[Optional[StrictInt], Field(description="Tour ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Mark the specified step as completed for the current user

        Mark the specified step as completed for the current user

        :param context: Context ID (required)
        :type context: int
        :param pageurl: Page URL (required)
        :type pageurl: str
        :param stepid: Step ID (required)
        :type stepid: int
        :param stepindex: Step Number (required)
        :type stepindex: int
        :param tourid: Tour ID (required)
        :type tourid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_usertours_step_shown_serialize(
            context=context,
            pageurl=pageurl,
            stepid=stepid,
            stepindex=stepindex,
            tourid=tourid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_usertours_step_shown_without_preload_content(
        self,
        context: Annotated[Optional[StrictInt], Field(description="Context ID")],
        pageurl: Annotated[Optional[StrictStr], Field(description="Page URL")],
        stepid: Annotated[Optional[StrictInt], Field(description="Step ID")],
        stepindex: Annotated[Optional[StrictInt], Field(description="Step Number")],
        tourid: Annotated[Optional[StrictInt], Field(description="Tour ID")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Mark the specified step as completed for the current user

        Mark the specified step as completed for the current user

        :param context: Context ID (required)
        :type context: int
        :param pageurl: Page URL (required)
        :type pageurl: str
        :param stepid: Step ID (required)
        :type stepid: int
        :param stepindex: Step Number (required)
        :type stepindex: int
        :param tourid: Tour ID (required)
        :type tourid: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_usertours_step_shown_serialize(
            context=context,
            pageurl=pageurl,
            stepid=stepid,
            stepindex=stepindex,
            tourid=tourid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_usertours_step_shown_serialize(
        self,
        context,
        pageurl,
        stepid,
        stepindex,
        tourid,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_usertours_step_shown'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_usertours_step_shown'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_usertours_step_shown',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if context is not None:
            _form_params += parse_form({'context': context})
        if pageurl is not None:
            _form_params += parse_form({'pageurl': pageurl})
        if stepid is not None:
            _form_params += parse_form({'stepid': stepid})
        if stepindex is not None:
            _form_params += parse_form({'stepindex': stepindex})
        if tourid is not None:
            _form_params += parse_form({'tourid': tourid})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def tool_xmldb_invoke_move_action_args(
        self,
        action: Annotated[Optional[StrictStr], Field(description="Action")],
        dir: Annotated[Optional[StrictStr], Field(description="Plugin that is being edited")],
        position: Annotated[Optional[StrictInt], Field(description="How many positions to move by (negative - up, positive - down)")],
        table: Annotated[Optional[StrictStr], Field(description="Table name")],
        var_field: Annotated[Optional[StrictStr], Field(description="Field name")] = None,
        index: Annotated[Optional[StrictStr], Field(description="Index name")] = None,
        key: Annotated[Optional[StrictStr], Field(description="Key name")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ):
        """moves element up/down

        moves element up/down

        :param action: Action (required)
        :type action: str
        :param dir: Plugin that is being edited (required)
        :type dir: str
        :param position: How many positions to move by (negative - up, positive - down) (required)
        :type position: int
        :param table: Table name (required)
        :type table: str
        :param var_field: Field name
        :type var_field: str
        :param index: Index name
        :type index: str
        :param key: Key name
        :type key: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_xmldb_invoke_move_action_serialize(
            action=action,
            dir=dir,
            position=position,
            table=table,
            var_field=var_field,
            index=index,
            key=key,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        return self.api_client.build_api_call(
            *_param,
            _request_timeout=_request_timeout
        )


    @validate_call
    async def tool_xmldb_invoke_move_action(
        self,
        action: Annotated[Optional[StrictStr], Field(description="Action")],
        dir: Annotated[Optional[StrictStr], Field(description="Plugin that is being edited")],
        position: Annotated[Optional[StrictInt], Field(description="How many positions to move by (negative - up, positive - down)")],
        table: Annotated[Optional[StrictStr], Field(description="Table name")],
        var_field: Annotated[Optional[StrictStr], Field(description="Field name")] = None,
        index: Annotated[Optional[StrictStr], Field(description="Index name")] = None,
        key: Annotated[Optional[StrictStr], Field(description="Key name")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """moves element up/down

        moves element up/down

        :param action: Action (required)
        :type action: str
        :param dir: Plugin that is being edited (required)
        :type dir: str
        :param position: How many positions to move by (negative - up, positive - down) (required)
        :type position: int
        :param table: Table name (required)
        :type table: str
        :param var_field: Field name
        :type var_field: str
        :param index: Index name
        :type index: str
        :param key: Key name
        :type key: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_xmldb_invoke_move_action_serialize(
            action=action,
            dir=dir,
            position=position,
            table=table,
            var_field=var_field,
            index=index,
            key=key,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_xmldb_invoke_move_action_from_args(
        self,
        args
    ) -> object:
        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api_from_args(
            args
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def tool_xmldb_invoke_move_action_with_http_info(
        self,
        action: Annotated[Optional[StrictStr], Field(description="Action")],
        dir: Annotated[Optional[StrictStr], Field(description="Plugin that is being edited")],
        position: Annotated[Optional[StrictInt], Field(description="How many positions to move by (negative - up, positive - down)")],
        table: Annotated[Optional[StrictStr], Field(description="Table name")],
        var_field: Annotated[Optional[StrictStr], Field(description="Field name")] = None,
        index: Annotated[Optional[StrictStr], Field(description="Index name")] = None,
        key: Annotated[Optional[StrictStr], Field(description="Key name")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """moves element up/down

        moves element up/down

        :param action: Action (required)
        :type action: str
        :param dir: Plugin that is being edited (required)
        :type dir: str
        :param position: How many positions to move by (negative - up, positive - down) (required)
        :type position: int
        :param table: Table name (required)
        :type table: str
        :param var_field: Field name
        :type var_field: str
        :param index: Index name
        :type index: str
        :param key: Key name
        :type key: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_xmldb_invoke_move_action_serialize(
            action=action,
            dir=dir,
            position=position,
            table=table,
            var_field=var_field,
            index=index,
            key=key,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    async def tool_xmldb_invoke_move_action_without_preload_content(
        self,
        action: Annotated[Optional[StrictStr], Field(description="Action")],
        dir: Annotated[Optional[StrictStr], Field(description="Plugin that is being edited")],
        position: Annotated[Optional[StrictInt], Field(description="How many positions to move by (negative - up, positive - down)")],
        table: Annotated[Optional[StrictStr], Field(description="Table name")],
        var_field: Annotated[Optional[StrictStr], Field(description="Field name")] = None,
        index: Annotated[Optional[StrictStr], Field(description="Index name")] = None,
        key: Annotated[Optional[StrictStr], Field(description="Key name")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """moves element up/down

        moves element up/down

        :param action: Action (required)
        :type action: str
        :param dir: Plugin that is being edited (required)
        :type dir: str
        :param position: How many positions to move by (negative - up, positive - down) (required)
        :type position: int
        :param table: Table name (required)
        :type table: str
        :param var_field: Field name
        :type var_field: str
        :param index: Index name
        :type index: str
        :param key: Key name
        :type key: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._tool_xmldb_invoke_move_action_serialize(
            action=action,
            dir=dir,
            position=position,
            table=table,
            var_field=var_field,
            index=index,
            key=key,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _tool_xmldb_invoke_move_action_serialize(
        self,
        action,
        dir,
        position,
        table,
        var_field,
        index,
        key,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _resource_path = '/webservice/rest/server.php#tool_xmldb_invoke_move_action'.split('#')[0]

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if '/webservice/rest/server.php' in _resource_path:
            _query_params.append(('moodlewsrestformat', 'json'))
            _query_params.append(('wsfunction', 'tool_xmldb_invoke_move_action'))
        if '/lib/ajax/service-nologin.php' in _resource_path:
            _args_param = None
            for _param in _query_params:
                if _param[0] == 'args':
                    _args_param = _param
            if _args_param is not None:
                _query_params.remove(_args_param)
            else:
                _args_param = ('args', {})
            _new_args = ('args', json.dumps([{
                'index': 0,
                'methodname': 'tool_xmldb_invoke_move_action',
                'args': _args_param[1]
            }]))
            _query_params.append(_new_args)
        # process the header parameters
        # process the form parameters
        if action is not None:
            _form_params += parse_form({'action': action})
        if dir is not None:
            _form_params += parse_form({'dir': dir})
        if var_field is not None:
            _form_params += parse_form({'field': var_field})
        if index is not None:
            _form_params += parse_form({'index': index})
        if key is not None:
            _form_params += parse_form({'key': key})
        if position is not None:
            _form_params += parse_form({'position': position})
        if table is not None:
            _form_params += parse_form({'table': table})
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/x-www-form-urlencoded'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'wstoken'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path=_resource_path,
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


